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(
|
||||
batch.map(async (pendingEmail) => {
|
||||
try {
|
||||
const document = await this.indexEmailById(pendingEmail.archivedEmailId);
|
||||
const document = await this.indexEmailById(
|
||||
pendingEmail.archivedEmailId
|
||||
);
|
||||
if (document) {
|
||||
return document;
|
||||
}
|
||||
@@ -119,7 +121,10 @@ export class IndexingService {
|
||||
} else if (result.status === 'rejected') {
|
||||
logger.error({ error: result.reason }, 'Failed to process email in batch');
|
||||
} 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 !== 'providerConfig' &&
|
||||
originalSource[key as keyof IngestionSource] !==
|
||||
decryptedSource[key as keyof IngestionSource]
|
||||
decryptedSource[key as keyof IngestionSource]
|
||||
);
|
||||
if (changedFields.length > 0) {
|
||||
await this.auditService.createAuditLog({
|
||||
|
||||
@@ -117,7 +117,7 @@ export class StorageService implements IStorageProvider {
|
||||
if (!prefix.equals(ENCRYPTION_PREFIX)) {
|
||||
// File is not encrypted, return a new stream containing the buffered prefix and the rest of the original stream
|
||||
const combinedStream = new Readable({
|
||||
read() { },
|
||||
read() {},
|
||||
});
|
||||
combinedStream.push(prefixAndIvBuffer);
|
||||
stream.on('data', (chunk) => {
|
||||
|
||||
@@ -139,7 +139,6 @@ export class PSTConnector implements IEmailConnector {
|
||||
if (!fileExist) {
|
||||
throw Error('PST file upload not finished yet, please wait.');
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (error) {
|
||||
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')
|
||||
)
|
||||
.digest('hex')}-${createHash('sha256')
|
||||
.update(emlBuffer ?? Buffer.from(msg.subject || '', 'utf-8'))
|
||||
.digest('hex')}-${msg.clientSubmitTime?.getTime()}`;
|
||||
.update(emlBuffer ?? Buffer.from(msg.subject || '', 'utf-8'))
|
||||
.digest('hex')}-${msg.clientSubmitTime?.getTime()}`;
|
||||
}
|
||||
return {
|
||||
id: messageId,
|
||||
|
||||
Reference in New Issue
Block a user