Skip to content

Commit

Permalink
Remove TargetedMessaging file processor unlocking at shutdown (#2051)
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorgomezv authored Oct 24, 2024
1 parent f4e701e commit fc2bdec
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/datasources/targeted-messaging/outreach-file-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ import { ITargetedMessagingDatasource } from '@/domain/interfaces/targeted-messa
import { Outreach } from '@/domain/targeted-messaging/entities/outreach.entity';
import { ILoggingService, LoggingService } from '@/logging/logging.interface';
import { asError } from '@/logging/utils';
import {
Inject,
Injectable,
OnModuleDestroy,
type OnModuleInit,
} from '@nestjs/common';
import { Inject, Injectable, type OnModuleInit } from '@nestjs/common';
import { createHash } from 'crypto';
import { readFile } from 'fs/promises';
import path from 'path';

@Injectable()
export class OutreachFileProcessor implements OnModuleInit, OnModuleDestroy {
export class OutreachFileProcessor implements OnModuleInit {
private readonly storageType: FileStorageType;
private readonly localBaseDir: string;

Expand Down Expand Up @@ -64,12 +59,6 @@ export class OutreachFileProcessor implements OnModuleInit, OnModuleDestroy {
}
}

async onModuleDestroy(): Promise<void> {
await this.cacheService.deleteByKey(
CacheRouter.getOutreachFileProcessorCacheKey(),
);
}

private async processOutreachFiles(): Promise<void> {
const outreaches = await this.datasource.getUnprocessedOutreaches();
for (const outreach of outreaches) {
Expand Down

0 comments on commit fc2bdec

Please sign in to comment.