Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update expiration time on callback params while return duplicate…(MAPCO-3957) #84

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: exporter-trigger
description: A Helm chart for exporter-trigger service
type: application
version: 2.17.4
appVersion: 2.17.4
version: 2.17.5
appVersion: 2.17.5
4 changes: 4 additions & 0 deletions src/clients/jobManagerWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ export class JobManagerWrapper extends JobManagerClient {
cleanupExpirationTimeUTC: newExpirationDate,
directoryPath: job.parameters.relativeDirectoryPath,
},
callbackParams: {
...job.parameters.callbackParams,
expirationTime: newExpirationDate,
},
},
});
} else {
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/clients/jobManagerClient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ describe('JobManagerClient', () => {
parameters: {
...completedJob.parameters,
cleanupData: { ...completedJob.parameters.cleanupData, cleanupExpirationTimeUTC: testExpirationDate },
callbackParams: { ...completedJob.parameters.callbackParams, expirationTime: testExpirationDate },
},
});

Expand All @@ -145,8 +146,11 @@ describe('JobManagerClient', () => {
expect(putFun).toHaveBeenCalledTimes(1);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
const expirationParamCall: Date = putFun.mock.calls[0][1].parameters.cleanupData.cleanupExpirationTimeUTC;
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
const expirationCallbackParams: Date = putFun.mock.calls[0][1].parameters.callbackParams.expirationTime;
expirationParamCall.setSeconds(0, 0);
expect(JSON.stringify(expirationParamCall)).toBe(JSON.stringify(expectedNewExpirationDate));
expect(JSON.stringify(expirationCallbackParams)).toBe(JSON.stringify(expectedNewExpirationDate));
});

/**
Expand Down
Loading