generated from MapColonies/ts-server-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Finalize-tasks-polling (MAPCO-2888) (#59)
* feat: polling with finalize task - first commit * chore : adding unit testing + polling logic update for failures * chore: changes to polling * chore: pr notes + refactor * fix: lint * fix: pr notes + fixes * fix: pr notes * chore: update helm values * chore: update methods --------- Co-authored-by: asafMasa <[email protected]>
- Loading branch information
1 parent
921ef84
commit 6e2a861
Showing
28 changed files
with
1,054 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { TaskHandler as QueueHandler, JobManagerClient } from '@map-colonies/mc-priority-queue'; | ||
import { inject, singleton } from 'tsyringe'; | ||
import { Logger } from '@map-colonies/js-logger'; | ||
import { IHttpRetryConfig } from '@map-colonies/mc-utils'; | ||
import { IConfig, IQueueConfig } from '../common/interfaces'; | ||
import { SERVICES } from '../common/constants'; | ||
|
||
@singleton() | ||
export class QueueClient { | ||
public readonly queueHandlerForFinalizeTasks: QueueHandler; | ||
public readonly jobsClient: JobManagerClient; | ||
|
||
public constructor( | ||
@inject(SERVICES.CONFIG) config: IConfig, | ||
@inject(SERVICES.LOGGER) private readonly logger: Logger, | ||
@inject(SERVICES.QUEUE_CONFIG) private readonly queueConfig: IQueueConfig | ||
) { | ||
this.queueHandlerForFinalizeTasks = new QueueHandler( | ||
logger, | ||
this.queueConfig.jobType, | ||
this.queueConfig.jobManagerBaseUrl, | ||
this.queueConfig.heartbeatManagerBaseUrl, | ||
this.queueConfig.dequeueFinalizeIntervalMs, | ||
this.queueConfig.heartbeatIntervalMs, | ||
config.get<IHttpRetryConfig>('externalClientsConfig.httpRetry'), | ||
undefined, | ||
undefined, | ||
config.get<boolean>('externalClientsConfig.disableHttpClientLogs'), | ||
config.get<boolean>('externalClientsConfig.disableHttpClientLogs') | ||
); | ||
this.jobsClient = new JobManagerClient( | ||
logger, | ||
this.queueConfig.jobType, | ||
this.queueConfig.jobManagerBaseUrl, | ||
config.get<IHttpRetryConfig>('externalClientsConfig.httpRetry'), | ||
'jobManagerClient', | ||
config.get<boolean>('externalClientsConfig.disableHttpClientLogs') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.