Skip to content

Commit

Permalink
fix: update expiration time on callback params while return duplicate…
Browse files Browse the repository at this point in the history
… success response
  • Loading branch information
CL-SHLOMIKONCHA committed Feb 19, 2024
1 parent 01c6c84 commit 3e92576
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
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

0 comments on commit 3e92576

Please sign in to comment.