Skip to content
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
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@nestjs/common": "^10.0.2",
"@nestjs/core": "^10.0.2",
"@nestjs/platform-express": "^10.0.2",
"@omotes/proto": "^0.1.14",
"@omotes/proto": "^1.2.0",
"amqplib": "^0.10.3",
"axios": "^1.6.0",
"express": "^4.18.1",
Expand Down
2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"amqplib": "0.10.3",
"uuidv7": "0.6.3",
"tslib": "2.6.2",
"@omotes/proto": "^0.1.14",
"@omotes/proto": "^1.2.0",
"google-protobuf": "^3.21.2",
"influx": "^5.9.3"
},
Expand Down
8 changes: 4 additions & 4 deletions sdk/src/lib/Job.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobCancel, JobSubmission } from '@omotes/proto';
import { JobDelete, JobSubmission } from '@omotes/proto';
import { Channel, Connection } from 'amqplib';
import { MockChannel, MockConnection } from '../util/MockChannel.spec';
import { Job } from './Job';
Expand Down Expand Up @@ -32,10 +32,10 @@ describe('Job', () => {

describe('#cancel', () => {
it('should send job cancel', () => {
job.cancel();
expect(channel.sendToQueue).toHaveBeenCalledWith('job_cancellations', expect.any(Buffer), { persistent: true });
job.delete();
expect(channel.sendToQueue).toHaveBeenCalledWith('job_deletions', expect.any(Buffer), { persistent: true });
const submission = channel.sendToQueue.mock.calls[0][1];
const message = JobCancel.deserializeBinary(submission);
const message = JobDelete.deserializeBinary(submission);
expect(message.toObject()).toEqual(expect.objectContaining({
uuid: job.uuid
}));
Expand Down
12 changes: 6 additions & 6 deletions sdk/src/lib/Job.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { JobCancel, JobSubmission, Workflow } from '@omotes/proto';
import { JobDelete, JobSubmission, Workflow } from '@omotes/proto';
import { Channel, Connection } from 'amqplib';
import { JavaScriptValue, Struct } from 'google-protobuf/google/protobuf/struct_pb';
import { from } from 'rxjs';
Expand Down Expand Up @@ -33,10 +33,10 @@ export class Job {
return this;
}

public cancel() {
const cancel = new JobCancel();
cancel.setUuid(this.uuid);
this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(cancel), { persistent: true });
public delete() {
const jobDelete = new JobDelete();
jobDelete.setUuid(this.uuid);
this.channel.sendToQueue(getCancellationsQueue(), this.toBuffer(jobDelete), { persistent: true });
return this;
}

Expand Down Expand Up @@ -72,7 +72,7 @@ export class Job {
return channel;
}

private toBuffer(message: JobSubmission | JobCancel) {
private toBuffer(message: JobSubmission | JobDelete) {
return Buffer.from(message.serializeBinary());
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/lib/queue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ describe('Queue functions', () => {

it('getCancelQueue returns correct queue name', () => {
const result = getCancellationsQueue();
expect(result).toEqual(`job_cancellations`);
expect(result).toEqual(`job_deletions`);
});
});
2 changes: 1 addition & 1 deletion sdk/src/lib/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export function getStatusQueue(job: Job) {
}

export function getCancellationsQueue() {
return `job_cancellations`;
return `job_deletions`;
}