Skip to content

Commit a31137b

Browse files
authored
Merge pull request #37 from Project-OMOTES/WouterSpaak/issue34
Change queue name for job cancellations to job deletions for upcoming OMOTES release 0.0.9
2 parents 793fcb8 + e977383 commit a31137b

7 files changed

Lines changed: 18 additions & 19 deletions

File tree

package-lock.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@nestjs/common": "^10.0.2",
8484
"@nestjs/core": "^10.0.2",
8585
"@nestjs/platform-express": "^10.0.2",
86-
"@omotes/proto": "^0.1.14",
86+
"@omotes/proto": "^1.2.0",
8787
"amqplib": "^0.10.3",
8888
"axios": "^1.6.0",
8989
"express": "^4.18.1",

sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"amqplib": "0.10.3",
1212
"uuidv7": "0.6.3",
1313
"tslib": "2.6.2",
14-
"@omotes/proto": "^0.1.14",
14+
"@omotes/proto": "^1.2.0",
1515
"google-protobuf": "^3.21.2",
1616
"influx": "^5.9.3"
1717
},

sdk/src/lib/Job.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JobCancel, JobSubmission } from '@omotes/proto';
1+
import { JobDelete, JobSubmission } from '@omotes/proto';
22
import { Channel, Connection } from 'amqplib';
33
import { MockChannel, MockConnection } from '../util/MockChannel.spec';
44
import { Job } from './Job';
@@ -32,10 +32,10 @@ describe('Job', () => {
3232

3333
describe('#cancel', () => {
3434
it('should send job cancel', () => {
35-
job.cancel();
36-
expect(channel.sendToQueue).toHaveBeenCalledWith('job_cancellations', expect.any(Buffer), { persistent: true });
35+
job.delete();
36+
expect(channel.sendToQueue).toHaveBeenCalledWith('job_deletions', expect.any(Buffer), { persistent: true });
3737
const submission = channel.sendToQueue.mock.calls[0][1];
38-
const message = JobCancel.deserializeBinary(submission);
38+
const message = JobDelete.deserializeBinary(submission);
3939
expect(message.toObject()).toEqual(expect.objectContaining({
4040
uuid: job.uuid
4141
}));

sdk/src/lib/Job.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { JobCancel, JobSubmission, Workflow } from '@omotes/proto';
1+
import { JobDelete, JobSubmission, Workflow } from '@omotes/proto';
22
import { Channel, Connection } from 'amqplib';
33
import { JavaScriptValue, Struct } from 'google-protobuf/google/protobuf/struct_pb';
44
import { from } from 'rxjs';
@@ -33,10 +33,10 @@ export class Job {
3333
return this;
3434
}
3535

36-
public cancel() {
37-
const cancel = new JobCancel();
38-
cancel.setUuid(this.uuid);
39-
this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(cancel), { persistent: true });
36+
public delete() {
37+
const jobDelete = new JobDelete();
38+
jobDelete.setUuid(this.uuid);
39+
this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(jobDelete), { persistent: true });
4040
return this;
4141
}
4242

@@ -72,7 +72,7 @@ export class Job {
7272
return channel;
7373
}
7474

75-
private toBuffer(message: JobSubmission | JobCancel) {
75+
private toBuffer(message: JobSubmission | JobDelete) {
7676
return Buffer.from(message.serializeBinary());
7777
}
7878

sdk/src/lib/queue.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ describe('Queue functions', () => {
2626

2727
it('getCancelQueue returns correct queue name', () => {
2828
const result = getCancellationsQueue();
29-
expect(result).toEqual(`job_cancellations`);
29+
expect(result).toEqual(`job_deletions`);
3030
});
3131
});

sdk/src/lib/queue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ export function getStatusQueue(job: Job) {
1717
}
1818

1919
export function getCancellationsQueue() {
20-
return `job_cancellations`;
20+
return `job_deletions`;
2121
}

0 commit comments

Comments
 (0)