Skip to content

Commit

Permalink
Paul code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kennsippell committed Dec 13, 2024
1 parent a00a2f9 commit 39c0d1a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/config/config-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const WorkerConfig = {
host: environment.REDIS_HOST,
port: Number(environment.REDIS_PORT),
},
moveContactQueue: 'MOVE_CONTACT_QUEUE',
chtConfQueueName: 'MOVE_CONTACT_QUEUE',
defaultJobOptions: {
attempts: 3, // Max retries for a failed job
backoff: {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class BullQueue implements IQueue {
}

export const getChtConfQueue = () => new BullQueue(
WorkerConfig.moveContactQueue,
WorkerConfig.chtConfQueueName,
WorkerConfig.redisConnection,
WorkerConfig.defaultJobOptions
);
2 changes: 1 addition & 1 deletion src/liquid/place/manage_hierarchy_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h1 class="subtitle">{{ destinationDescription }}</h1>
pauseOnHover: true,
type: 'is-success',
position: 'top-center',
message: `<p>Operation has been scheduled. Please allow up to 24 hours for processing.</p>`,
message: `<p>{{ op | capitalize }} operation scheduled. Please allow up to 24 hours for processing.</p>`,
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/worker/cht-conf-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class ChtConfWorker {
throw new DelayedError();
}

const result = await this.moveContact(job);
const result = await this.processChtConfJob(job);
if (!result.success) {
const errorMessage = `Job ${job.id} failed with the following error: ${result.message}`;
console.error(errorMessage);
Expand Down Expand Up @@ -109,7 +109,7 @@ export class ChtConfWorker {
return axios.get(`${instanceUrl}/api/v2/monitoring`);
}

private static async moveContact(job: Job): Promise<JobResult> {
private static async processChtConfJob(job: Job): Promise<JobResult> {
try {
const jobData: ChtConfJobData = job.data;

Expand Down
4 changes: 2 additions & 2 deletions src/worker/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { ChtConfWorker } from './cht-conf-worker';
import { WorkerConfig, checkRedisConnection } from '../config/config-worker';

(async () => {
const { moveContactQueue, redisConnection} = WorkerConfig;
const { chtConfQueueName, redisConnection } = WorkerConfig;
await checkRedisConnection();
ChtConfWorker.processQueue(
moveContactQueue,
chtConfQueueName,
redisConnection
);
console.log(`🚀 CHT Conf Worker is listening`);
Expand Down

0 comments on commit 39c0d1a

Please sign in to comment.