New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lokalise/background-jobs-common

Package Overview
Dependencies
Maintainers
0
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lokalise/background-jobs-common - npm Package Compare versions

Comparing version 7.0.3 to 7.1.0

2

dist/background-job-processor/processors/AbstractBackgroundJobProcessor.d.ts

@@ -30,3 +30,3 @@ import { type Job, type JobsOptions, type Queue, type QueueOptions, type Worker, type WorkerOptions } from 'bullmq';

schedule(jobData: JobPayload, options?: JobOptionsType): Promise<string>;
scheduleBulk(jobData: JobPayload[], options?: JobOptionsType): Promise<string[]>;
scheduleBulk(jobData: JobPayload[], options?: Omit<JobOptionsType, 'repeat'>): Promise<string[]>;
/**

@@ -33,0 +33,0 @@ * Get jobs in the given states.

@@ -125,4 +125,11 @@ "use strict";

async schedule(jobData, options) {
const jobIds = await this.scheduleBulk([jobData], options);
return jobIds[0];
await this.startIfNotStarted();
const job = await this._queue?.add(this.config.queueId, jobData, (0, utils_1.prepareJobOptions)(this.config.isTest, options));
if (!job?.id) {
throw new Error('Scheduled job ID is undefined');
}
if (this._spy) {
this._spy.addJob(job, 'scheduled');
}
return job.id;
}

@@ -144,5 +151,3 @@ async scheduleBulk(jobData, options) {

if (this._spy) {
for (const job of jobs) {
this._spy.addJob(job, 'scheduled');
}
this._spy.addJobs(jobs, 'scheduled');
}

@@ -149,0 +154,0 @@ return jobIds;

@@ -24,2 +24,3 @@ import type { SafeJob } from '../types';

addJob(job: SafeJob<JobData>, state: JobSpyState): void;
addJobs(jobs: SafeJob<JobData>[], state: JobSpyState): void;
}

@@ -70,3 +70,8 @@ "use strict";

}
addJobs(jobs, state) {
for (const job of jobs) {
this.addJob(job, state);
}
}
}
exports.BackgroundJobProcessorSpy = BackgroundJobProcessorSpy;

@@ -19,5 +19,5 @@ import type { FinishedStatus, Job, JobsOptions, Queue } from 'bullmq';

data: DataType;
opts?: JobsOptionsType;
opts?: Omit<JobsOptionsType, 'repeat'>;
}[]): Promise<SafeJob<DataType, ResultType, NameType>[]>;
};
export type BullmqProcessor<J extends SafeJob<T, R, N>, T = any, R = any, N extends string = string> = (job: J, token?: string) => Promise<R>;
{
"name": "@lokalise/background-jobs-common",
"version": "7.0.3",
"version": "7.1.0",
"files": ["dist", "LICENSE.md", "README.md"],

@@ -5,0 +5,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc