Skip to content

Commit

Permalink
chore: Release v1.2.2 - See CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-KumarH committed Nov 22, 2023
1 parent 8badfb1 commit 0e3637a
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 35 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.2.2 (November 22nd, 2023)

- added support to specify queue_name when creating the job

## 1.2.1 (November 21st, 2023)

- up deps (changed expires_in to date timestamp)
Expand Down
52 changes: 26 additions & 26 deletions package-lock.json

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

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@restorecommerce/scheduling-srv",
"version": "1.2.1",
"version": "1.2.2",
"description": "Restorecommerce job scheduling microservice",
"main": "lib/start.js",
"author": "n-fuse GmbH",
Expand All @@ -20,13 +20,13 @@
"@bull-board/api": "^5.9.1",
"@bull-board/express": "^5.9.1",
"@bull-board/koa": "^5.9.1",
"@restorecommerce/acs-client": "^1.3.2",
"@restorecommerce/acs-client": "1.3.2",
"@restorecommerce/chassis-srv": "^1.4.2",
"@restorecommerce/cluster-service": "^1.0.1",
"@restorecommerce/kafka-client": "^1.1.9",
"@restorecommerce/kafka-client": "^1.1.11",
"@restorecommerce/logger": "^1.2.8",
"@restorecommerce/rc-grpc-clients": "^5.1.9",
"@restorecommerce/scs-jobs": "^0.1.4",
"@restorecommerce/rc-grpc-clients": "^5.1.11",
"@restorecommerce/scs-jobs": "^0.1.9",
"@restorecommerce/service-config": "^1.0.10",
"bullmq": "^4.14.0",
"cache-manager": "^5.3.1",
Expand All @@ -42,8 +42,8 @@
"@grpc/proto-loader": "^0.7.10",
"@restorecommerce/grpc-client": "^2.0.8",
"@types/lodash": "^4.14.202",
"@types/mocha": "^10.0.5",
"@types/node": "^20.9.3",
"@types/mocha": "^10.0.6",
"@types/node": "^20.9.4",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"coveralls": "^3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion src/schedulingService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ export class SchedulingService implements SchedulingServiceServiceImplementation

// Match the Job Type with the Queue Name and add the Job to this Queue.
// If there is no match, add the Job to the Default Queue
let queue = _.find(this.queuesList, { name: job.type });
let queue = _.find(this.queuesList, { name: job?.queue_name });
if (_.isEmpty(queue)) {
queue = _.find(this.queuesList, { name: this.defaultQueueName });
}
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface NewJob {
when?: string;
data: Data;
id?: string; // mapped to jobId of bull
queue_name?: string;
}

export enum SortOrder {
Expand Down
2 changes: 1 addition & 1 deletion src/utilts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export function _filterQueuedJob<T extends FilterOpts>(job: T, logger: Logger):

export function _filterKafkaJob<T extends KafkaOpts>(job: T, logger: Logger): Pick<T, 'id' | 'type' | 'data' | 'options' | 'when'> {
const picked: any = _.pick(job, [
'id', 'type', 'data', 'options', 'when'
'id', 'type', 'data', 'options', 'when', 'queue_name'
]);

if (picked?.data?.payload?.value) {
Expand Down
6 changes: 6 additions & 0 deletions test/grpc_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {

const job = {
type: 'test-job',
queue_name: 'test-job',
data,
options: {
timeout: 1,
Expand Down Expand Up @@ -373,6 +374,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {
scheduledTime.setSeconds(scheduledTime.getSeconds() + 4);
const job = {
type: 'test-job',
queue_name: 'test-job',
data,
when: scheduledTime.toISOString(),
options: {
Expand Down Expand Up @@ -413,6 +415,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {

const job = {
type: 'external-job',
queue_name: 'external-job',
data: {
payload: marshallProtobufAny({
testValue: 'test-value'
Expand Down Expand Up @@ -479,6 +482,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {

const job = {
type: 'test-job',
queue_name: 'test-job',
data,
options: {
priority: JobOptions_Priority.HIGH,
Expand Down Expand Up @@ -525,6 +529,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {
const job = {
id: 'test-job-id',
type: 'test-job',
queue_name: 'test-job',
data,
options: {
priority: JobOptions_Priority.HIGH,
Expand Down Expand Up @@ -587,6 +592,7 @@ describe(`testing scheduling-srv ${testSuffix}: gRPC`, () => {
for (let i = 0; i < 4; i += 1) {
jobs[i] = {
type: 'test-job',
queue_name: 'test-job',
data,
when: scheduledTime.toISOString(),
options: {
Expand Down
4 changes: 4 additions & 0 deletions test/kafka_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ describe(`testing scheduling-srv ${testSuffix}: Kafka`, async () => {

const job = {
type: 'test-job',
queue_name: 'test-job',
data,
options: {
timeout: 1,
Expand Down Expand Up @@ -356,6 +357,7 @@ describe(`testing scheduling-srv ${testSuffix}: Kafka`, async () => {
scheduledTime.setSeconds(scheduledTime.getSeconds() + 4);
const job = {
type: 'test-job',
queue_name: 'test-job',
data,
when: scheduledTime.toISOString(),
options: {
Expand Down Expand Up @@ -429,6 +431,7 @@ describe(`testing scheduling-srv ${testSuffix}: Kafka`, async () => {

const job = {
type: 'test-job',
queue_name: 'test-job',
data,
options: {
priority: JobOptions_Priority.HIGH,
Expand Down Expand Up @@ -489,6 +492,7 @@ describe(`testing scheduling-srv ${testSuffix}: Kafka`, async () => {
for (let i = 0; i < 4; i += 1) {
jobs[i] = {
type: 'test-job',
queue_name: 'test-job',
data,
when: scheduledTime.toISOString(),
options: {
Expand Down

0 comments on commit 0e3637a

Please sign in to comment.