Skip to content

Commit

Permalink
fix: remove unused options
Browse files Browse the repository at this point in the history
  • Loading branch information
joebowbeer authored Jun 4, 2020
1 parent 55fff7f commit 23aadc3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 62 deletions.
20 changes: 0 additions & 20 deletions src/interfaces/advanced-options.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,8 @@
export interface AdvancedOptions {
// How often check for stalled jobs (use 0 for never checking).
stalledInterval?: number;

// Max amount of times a stalled job will be re-processed.
maxStalledCount?: number;

// Poll interval for delayed jobs and added jobs.
guardInterval?: number;

// delay before processing next job in case of internal error.
retryProcessDelay?: number;

// A set of custom backoff strategies keyed by name.
backoffStrategies?: {};

// A timeout for when the queue is in drained state (empty waiting for jobs).
drainDelay?: number;
}

export const AdvancedOptionsDefaults: AdvancedOptions = {
stalledInterval: 30000,
maxStalledCount: 1,
guardInterval: 5000,
retryProcessDelay: 5000,
backoffStrategies: {},
drainDelay: 5,
};
3 changes: 1 addition & 2 deletions src/interfaces/worker-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@ export interface WorkerOptions extends QueueBaseOptions {
drainDelay?: number;
lockDuration?: number;
lockRenewTime?: number;
visibilityWindow?: number; // seconds // FIXME not used?
settings?: AdvancedOptions; // FIXME not used?
settings?: AdvancedOptions; // FIXME only backoffStrategies is used
}
40 changes: 0 additions & 40 deletions src/test/test_sandboxed_process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ describe('sandboxed process', () => {

const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const completting = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -63,10 +59,6 @@ describe('sandboxed process', () => {
const processFile = __dirname + '/fixtures/fixture_processor.js';
const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const completting = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -106,10 +98,6 @@ describe('sandboxed process', () => {
worker = new Worker(queueName, processFile, {
concurrency: 4,
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const completing = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -145,10 +133,6 @@ describe('sandboxed process', () => {
worker = new Worker(queueName, processFile, {
concurrency: 1,
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

await Promise.all([
Expand Down Expand Up @@ -188,10 +172,6 @@ describe('sandboxed process', () => {

const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const progresses: any[] = [];
Expand Down Expand Up @@ -232,10 +212,6 @@ describe('sandboxed process', () => {

const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const failing = new Promise((resolve, reject) => {
Expand Down Expand Up @@ -285,10 +261,6 @@ describe('sandboxed process', () => {

const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const job = await queue.add('test', {});
Expand All @@ -304,10 +276,6 @@ describe('sandboxed process', () => {

new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const job = await queue.add('test', { exitCode: 0 });
Expand All @@ -325,10 +293,6 @@ describe('sandboxed process', () => {

new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const job = await queue.add('test', { exitCode: 1 });
Expand All @@ -346,10 +310,6 @@ describe('sandboxed process', () => {

const worker = new Worker(queueName, processFile, {
drainDelay: 1,
settings: {
guardInterval: 300000,
stalledInterval: 300000,
},
});

const completting = new Promise((resolve, reject) => {
Expand Down

0 comments on commit 23aadc3

Please sign in to comment.