mirror of
https://github.com/LogicLabs-OU/OpenArchiver.git
synced 2026-04-06 00:31:57 +02:00
formatting code (#206)
Co-authored-by: Wayne <5291640+ringoinca@users.noreply.github.com>
This commit is contained in:
@@ -95,7 +95,9 @@ export class IndexingService {
|
|||||||
const batchDocuments = await Promise.allSettled(
|
const batchDocuments = await Promise.allSettled(
|
||||||
batch.map(async (pendingEmail) => {
|
batch.map(async (pendingEmail) => {
|
||||||
try {
|
try {
|
||||||
const document = await this.indexEmailById(pendingEmail.archivedEmailId);
|
const document = await this.indexEmailById(
|
||||||
|
pendingEmail.archivedEmailId
|
||||||
|
);
|
||||||
if (document) {
|
if (document) {
|
||||||
return document;
|
return document;
|
||||||
}
|
}
|
||||||
@@ -119,7 +121,10 @@ export class IndexingService {
|
|||||||
} else if (result.status === 'rejected') {
|
} else if (result.status === 'rejected') {
|
||||||
logger.error({ error: result.reason }, 'Failed to process email in batch');
|
logger.error({ error: result.reason }, 'Failed to process email in batch');
|
||||||
} else {
|
} else {
|
||||||
logger.error({ result: result }, 'Failed to process email in batch, reason unknown.');
|
logger.error(
|
||||||
|
{ result: result },
|
||||||
|
'Failed to process email in batch, reason unknown.'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ export class IngestionService {
|
|||||||
(key) =>
|
(key) =>
|
||||||
key !== 'providerConfig' &&
|
key !== 'providerConfig' &&
|
||||||
originalSource[key as keyof IngestionSource] !==
|
originalSource[key as keyof IngestionSource] !==
|
||||||
decryptedSource[key as keyof IngestionSource]
|
decryptedSource[key as keyof IngestionSource]
|
||||||
);
|
);
|
||||||
if (changedFields.length > 0) {
|
if (changedFields.length > 0) {
|
||||||
await this.auditService.createAuditLog({
|
await this.auditService.createAuditLog({
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ export class StorageService implements IStorageProvider {
|
|||||||
if (!prefix.equals(ENCRYPTION_PREFIX)) {
|
if (!prefix.equals(ENCRYPTION_PREFIX)) {
|
||||||
// File is not encrypted, return a new stream containing the buffered prefix and the rest of the original stream
|
// File is not encrypted, return a new stream containing the buffered prefix and the rest of the original stream
|
||||||
const combinedStream = new Readable({
|
const combinedStream = new Readable({
|
||||||
read() { },
|
read() {},
|
||||||
});
|
});
|
||||||
combinedStream.push(prefixAndIvBuffer);
|
combinedStream.push(prefixAndIvBuffer);
|
||||||
stream.on('data', (chunk) => {
|
stream.on('data', (chunk) => {
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ export class PSTConnector implements IEmailConnector {
|
|||||||
if (!fileExist) {
|
if (!fileExist) {
|
||||||
throw Error('PST file upload not finished yet, please wait.');
|
throw Error('PST file upload not finished yet, please wait.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.error({ error, credentials: this.credentials }, 'PST file validation failed.');
|
logger.error({ error, credentials: this.credentials }, 'PST file validation failed.');
|
||||||
@@ -289,8 +288,8 @@ export class PSTConnector implements IEmailConnector {
|
|||||||
emlBuffer ?? Buffer.from(parsedEmail.text || parsedEmail.html || '', 'utf-8')
|
emlBuffer ?? Buffer.from(parsedEmail.text || parsedEmail.html || '', 'utf-8')
|
||||||
)
|
)
|
||||||
.digest('hex')}-${createHash('sha256')
|
.digest('hex')}-${createHash('sha256')
|
||||||
.update(emlBuffer ?? Buffer.from(msg.subject || '', 'utf-8'))
|
.update(emlBuffer ?? Buffer.from(msg.subject || '', 'utf-8'))
|
||||||
.digest('hex')}-${msg.clientSubmitTime?.getTime()}`;
|
.digest('hex')}-${msg.clientSubmitTime?.getTime()}`;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: messageId,
|
id: messageId,
|
||||||
|
|||||||
Reference in New Issue
Block a user