Preview
Preview Feature — This feature is currently in preview and under active development. APIs and functionality may change. We recommend testing thoroughly before using in production.
Job Management
Learn how to monitor, track, pause, resume, and cancel scheduled jobs in Ductape.
Job Lifecycle
Jobs in Ductape go through several states during their lifecycle:
scheduled → queued → running → completed
↘ ↘
failed cancelled
Job States
| State | Description |
|---|---|
scheduled | Job is scheduled but not yet queued for execution |
queued | Job is in the execution queue waiting to run |
running | Job is currently executing |
completed | Job finished successfully |
failed | Job failed after all retry attempts |
cancelled | Job was manually cancelled |
paused | Recurring job is paused and won't run until resumed |
Fetching Jobs
Get a Specific Job
- TypeScript
- Java
- Go
- .NET
// Fetch job by ID
const job = await ductape.jobs.get('job_abc123');
console.log('Job ID:', job.id);
console.log('Status:', job.status);
console.log('Scheduled At:', new Date(job.scheduled_at));
console.log('Recurring:', job.recurring);
// Fetch job by ID
Map<String, Object> job = ductape.jobs.get('job_abc123');
System.out.println('Job "ID", ", job.id);
System.out.println(""Status", ", job.status);
System.out.println("Scheduled "At", ", new Date(job.scheduled_at));
System.out.println("Recurring:', job.recurring);
// Fetch job by ID
job := client.jobs.get('job_abc123');
fmt.Println('Job "ID": ", job.id);
fmt.Println(""Status": ", job.status);
fmt.Println("Scheduled "At": ", new Date(job.scheduled_at));
fmt.Println("Recurring:', job.recurring);
// Fetch job by ID
var job = await ductape.jobs.get('job_abc123');
Console.WriteLine('Job ["ID"] = ", job.id);
Console.WriteLine("["Status"] = ", job.status);
Console.WriteLine("Scheduled ["At"] = ", new Date(job.scheduled_at));
Console.WriteLine("Recurring:', job.recurring);
List Jobs
- TypeScript
- Java
- Go
- .NET
// List all jobs
const jobs = await ductape.jobs.list();
// List with filters
const scheduledJobs = await ductape.jobs.list({
status: 'scheduled',
limit: 100,
offset: 0
});
// List jobs by product
const productJobs = await ductape.jobs.list({
});
// List recurring jobs only
const recurringJobs = await ductape.jobs.list({
recurring: true
});
// List all jobs
Map<String, Object> jobs = ductape.jobs.list();
// List with filters
Map<String, Object> scheduledJobs = ductape.jobs.list(Map.of(
"status", "scheduled",
"limit", 100,
"offset", 0
));
// List jobs by product
Map<String, Object> productJobs = ductape.jobs.list(Map.of(
));
// List recurring jobs only
Map<String, Object> recurringJobs = ductape.jobs.list(Map.of(
"recurring", true
));
// List all jobs
jobs := client.jobs.list();
// List with filters
scheduledJobs := client.jobs.list({
"status": "scheduled",
"limit": 100,
"offset": 0
});
// List jobs by product
productJobs := client.jobs.list({
});
// List recurring jobs only
recurringJobs := client.jobs.list({
"recurring": true
});
// List all jobs
var jobs = await ductape.jobs.list();
// List with filters
var scheduledJobs = await ductape.jobs.list({
["status"] = "scheduled",
["limit"] = 100,
["offset"] = 0
});
// List jobs by product
var productJobs = await ductape.jobs.list({
});
// List recurring jobs only
var recurringJobs = await ductape.jobs.list({
["recurring"] = true
});
List Options
interface IJobListOptions {
status?: 'scheduled' | 'queued' | 'running' | 'completed' | 'failed' | 'cancelled' | 'paused';
recurring?: boolean;
product?: string;
env?: string;
namespace?: string; // 'actions', 'features', 'notifications', etc.
limit?: number;
offset?: number;
from?: number | string; // Start date filter
to?: number | string; // End date filter
}
Job Information
Job Object Structure
interface IJob {
id: string;
status: JobStatus;
namespace: string; // Which dispatch created it
product: string;
env: string;
// Schedule info
scheduled_at: number;
started_at?: number;
completed_at?: number;
// Recurring info
recurring: boolean;
cron?: string;
every?: number;
next_run_at?: number;
execution_count: number;
limit?: number;
end_date?: number;
// Retry info
retries: number;
retry_count: number;
last_error?: string;
// Payload
input: Record<string, unknown>;
result?: Record<string, unknown>;
// Metadata
created_at: number;
updated_at: number;
}
Check Job Status
- TypeScript
- Java
- Go
- .NET
const job = await ductape.jobs.get('job_abc123');
if (job.status === 'completed') {
console.log('Job completed successfully');
console.log('Result:', job.result);
} else if (job.status === 'failed') {
console.log('Job failed after', job.retry_count, 'attempts');
console.log('Last error:', job.last_error);
} else if (job.status === 'running') {
console.log('Job is currently executing');
}
Map<String, Object> job = ductape.jobs.get('job_abc123');
if (job.status === 'completed') Map.of(
System.out.println('Job completed successfully');
System.out.println('"Result", ", job.result);
) else if (job.status === "failed') Map.of(
System.out.println('Job failed after', job.retry_count, 'attempts');
System.out.println('Last "error", ", job.last_error);
) else if (job.status === "running') Map.of(
System.out.println('Job is currently executing');
)
job := client.jobs.get('job_abc123');
if (job.status === 'completed') {
fmt.Println('Job completed successfully');
fmt.Println('"Result": ", job.result);
} else if (job.status === "failed') {
fmt.Println('Job failed after', job.retry_count, 'attempts');
fmt.Println('Last "error": ", job.last_error);
} else if (job.status === "running') {
fmt.Println('Job is currently executing');
}
var job = await ductape.jobs.get('job_abc123');
if (job.status === 'completed') {
Console.WriteLine('Job completed successfully');
Console.WriteLine('["Result"] = ", job.result);
} else if (job.status === "failed') {
Console.WriteLine('Job failed after', job.retry_count, 'attempts');
Console.WriteLine('Last ["error"] = ", job.last_error);
} else if (job.status === "running') {
Console.WriteLine('Job is currently executing');
}
Cancelling Jobs
Cancel a Single Job
- TypeScript
- Java
- Go
- .NET
// Cancel a scheduled job
await ductape.jobs.cancel('job_abc123');
// Cancel returns the updated job
const cancelledJob = await ductape.jobs.cancel('job_abc123');
console.log('Status:', cancelledJob.status); // 'cancelled'
// Cancel a scheduled job
ductape.jobs.cancel('job_abc123');
// Cancel returns the updated job
Map<String, Object> cancelledJob = ductape.jobs.cancel('job_abc123');
System.out.println('"Status", ", cancelledJob.status); // "cancelled'
// Cancel a scheduled job
client.jobs.cancel('job_abc123');
// Cancel returns the updated job
cancelledJob := client.jobs.cancel('job_abc123');
fmt.Println('"Status": ", cancelledJob.status); // "cancelled'
// Cancel a scheduled job
await ductape.jobs.cancel('job_abc123');
// Cancel returns the updated job
var cancelledJob = await ductape.jobs.cancel('job_abc123');
Console.WriteLine('["Status"] = ", cancelledJob.status); // "cancelled'
Cancel Multiple Jobs
- TypeScript
- Java
- Go
- .NET
// Cancel all scheduled jobs for a product
const cancelled = await ductape.jobs.cancelMany({
status: 'scheduled'
});
console.log('Cancelled jobs:', cancelled.count);
// Cancel all scheduled jobs for a product
Map<String, Object> cancelled = ductape.jobs.cancelMany(Map.of(
"status", "scheduled"
));
System.out.println('Cancelled jobs:', cancelled.count);
// Cancel all scheduled jobs for a product
cancelled := client.jobs.cancelMany({
"status": "scheduled"
});
fmt.Println('Cancelled jobs:', cancelled.count);
// Cancel all scheduled jobs for a product
var cancelled = await ductape.jobs.cancelMany({
["status"] = "scheduled"
});
Console.WriteLine('Cancelled jobs:', cancelled.count);
Cancel with Reason
- TypeScript
- Java
- Go
- .NET
await ductape.jobs.cancel('job_abc123', {
reason: 'Campaign ended early'
});
ductape.jobs.cancel('job_abc123', Map.of(
"reason", "Campaign ended early"
));
client.jobs.cancel('job_abc123', {
"reason": "Campaign ended early"
});
await ductape.jobs.cancel('job_abc123', {
["reason"] = "Campaign ended early"
});
Pausing and Resuming Jobs
Pause a Recurring Job
- TypeScript
- Java
- Go
- .NET
// Pause a recurring job - it won't run until resumed
await ductape.jobs.pause('job_abc123');
const job = await ductape.jobs.get('job_abc123');
console.log('Status:', job.status); // 'paused'
// Pause a recurring job - it won't run until resumed
ductape.jobs.pause('job_abc123');
Map<String, Object> job = ductape.jobs.get('job_abc123');
System.out.println('"Status", ", job.status); // "paused'
// Pause a recurring job - it won't run until resumed
client.jobs.pause('job_abc123');
job := client.jobs.get('job_abc123');
fmt.Println('"Status": ", job.status); // "paused'
// Pause a recurring job - it won't run until resumed
await ductape.jobs.pause('job_abc123');
var job = await ductape.jobs.get('job_abc123');
Console.WriteLine('["Status"] = ", job.status); // "paused'
Resume a Paused Job
- TypeScript
- Java
- Go
- .NET
// Resume a paused job
await ductape.jobs.resume('job_abc123');
const job = await ductape.jobs.get('job_abc123');
console.log('Status:', job.status); // 'scheduled'
console.log('Next run:', new Date(job.next_run_at));
// Resume a paused job
ductape.jobs.resume('job_abc123');
Map<String, Object> job = ductape.jobs.get('job_abc123');
System.out.println('"Status", ", job.status); // "scheduled'
System.out.println('Next run:', new Date(job.next_run_at));
// Resume a paused job
client.jobs.resume('job_abc123');
job := client.jobs.get('job_abc123');
fmt.Println('"Status": ", job.status); // "scheduled'
fmt.Println('Next run:', new Date(job.next_run_at));
// Resume a paused job
await ductape.jobs.resume('job_abc123');
var job = await ductape.jobs.get('job_abc123');
Console.WriteLine('["Status"] = ", job.status); // "scheduled'
Console.WriteLine('Next run:', new Date(job.next_run_at));
Pause All Jobs for a Product
- TypeScript
- Java
- Go
- .NET
// Pause all recurring jobs for maintenance
await ductape.jobs.pauseMany({
recurring: true
});
// Resume after maintenance
await ductape.jobs.resumeMany({
status: 'paused'
});
// Pause all recurring jobs for maintenance
ductape.jobs.pauseMany(Map.of(
"recurring", true
));
// Resume after maintenance
ductape.jobs.resumeMany(Map.of(
"status", "paused"
));
// Pause all recurring jobs for maintenance
client.jobs.pauseMany({
"recurring": true
});
// Resume after maintenance
client.jobs.resumeMany({
"status": "paused"
});
// Pause all recurring jobs for maintenance
await ductape.jobs.pauseMany({
["recurring"] = true
});
// Resume after maintenance
await ductape.jobs.resumeMany({
["status"] = "paused"
});
Rescheduling Jobs
Reschedule a Job
- TypeScript
- Java
- Go
- .NET
// Reschedule a job to a new time
await ductape.jobs.reschedule('job_abc123', {
start_at: Date.now() + 7200000 // 2 hours from now
});
// Reschedule a job to a new time
ductape.jobs.reschedule('job_abc123', Map.of(
start_at: Date.now() + 7200000 // 2 hours from now
));
// Reschedule a job to a new time
client.jobs.reschedule('job_abc123', {
start_at: Date.now() + 7200000 // 2 hours from now
});
// Reschedule a job to a new time
await ductape.jobs.reschedule('job_abc123', {
start_at: Date.now() + 7200000 // 2 hours from now
});
Update Recurring Schedule
- TypeScript
- Java
- Go
- .NET
// Change the cron schedule for a recurring job
await ductape.jobs.reschedule('job_abc123', {
cron: '0 10 * * *', // Change to 10 AM
tz: 'America/New_York'
});
// Change interval for interval-based job
await ductape.jobs.reschedule('job_abc123', {
every: 7200000 // Change to every 2 hours
});
// Change the cron schedule for a recurring job
ductape.jobs.reschedule('job_abc123', Map.of(
"cron", "0 10 * * *", // Change to 10 AM
"tz", "America/New_York"
));
// Change interval for interval-based job
ductape.jobs.reschedule('job_abc123', Map.of(
"every", 7200000 // Change to every 2 hours
));
// Change the cron schedule for a recurring job
client.jobs.reschedule('job_abc123', {
"cron": "0 10 * * *", // Change to 10 AM
"tz": "America/New_York"
});
// Change interval for interval-based job
client.jobs.reschedule('job_abc123', {
"every": 7200000 // Change to every 2 hours
});
// Change the cron schedule for a recurring job
await ductape.jobs.reschedule('job_abc123', {
["cron"] = "0 10 * * *", // Change to 10 AM
["tz"] = "America/New_York"
});
// Change interval for interval-based job
await ductape.jobs.reschedule('job_abc123', {
["every"] = 7200000 // Change to every 2 hours
});
Monitoring Job Execution
Get Execution History
- TypeScript
- Java
- Go
- .NET
// Get execution history for a recurring job
const history = await ductape.jobs.getHistory('job_abc123', {
limit: 10
});
for (const execution of history.executions) {
console.log(`Run ${execution.number}:`);
console.log(' Started:', new Date(execution.started_at));
console.log(' Duration:', execution.duration_ms, 'ms');
console.log(' Status:', execution.status);
if (execution.error) {
console.log(' Error:', execution.error);
}
}
// Get execution history for a recurring job
Map<String, Object> history = ductape.jobs.getHistory('job_abc123', Map.of(
"limit", 10
));
for (Map<String, Object> execution of history.executions) Map.of(
System.out.println(`Run $Map.of(execution.number):`);
System.out.println(' "Started", ", new Date(execution.started_at));
System.out.println(" "Duration", ", execution.duration_ms, "ms');
System.out.println(' "Status", ", execution.status);
if (execution.error) Map.of(
System.out.println(" Error:', execution.error);
)
)
// Get execution history for a recurring job
history := client.jobs.getHistory('job_abc123', {
"limit": 10
});
for (const execution of history.executions) {
fmt.Println(`Run ${execution.number}:`);
fmt.Println(' "Started": ", new Date(execution.started_at));
fmt.Println(" "Duration": ", execution.duration_ms, "ms');
fmt.Println(' "Status": ", execution.status);
if (execution.error) {
fmt.Println(" Error:', execution.error);
}
}
// Get execution history for a recurring job
var history = await ductape.jobs.getHistory('job_abc123', {
["limit"] = 10
});
for (var execution of history.executions) {
Console.WriteLine(`Run ${execution.number}:`);
Console.WriteLine(' ["Started"] = ", new Date(execution.started_at));
Console.WriteLine(" ["Duration"] = ", execution.duration_ms, "ms');
Console.WriteLine(' ["Status"] = ", execution.status);
if (execution.error) {
Console.WriteLine(" Error:', execution.error);
}
}
Execution History Response
interface IJobHistory {
job_id: string;
total_executions: number;
successful_executions: number;
failed_executions: number;
executions: IJobExecution[];
}
interface IJobExecution {
number: number;
started_at: number;
completed_at?: number;
duration_ms?: number;
status: 'completed' | 'failed';
error?: string;
result?: Record<string, unknown>;
}
Get Job Statistics
- TypeScript
- Java
- Go
- .NET
// Get statistics for all jobs in a product
const stats = await ductape.jobs.getStats({
});
console.log('Total jobs:', stats.total);
console.log('Scheduled:', stats.scheduled);
console.log('Running:', stats.running);
console.log('Completed:', stats.completed);
console.log('Failed:', stats.failed);
console.log('Success rate:', stats.success_rate);
// Get statistics for all jobs in a product
Map<String, Object> stats = ductape.jobs.getStats(Map.of(
));
System.out.println('Total "jobs", ", stats.total);
System.out.println(""Scheduled", ", stats.scheduled);
System.out.println(""Running", ", stats.running);
System.out.println(""Completed", ", stats.completed);
System.out.println(""Failed", ", stats.failed);
System.out.println("Success rate:', stats.success_rate);
// Get statistics for all jobs in a product
stats := client.jobs.getStats({
});
fmt.Println('Total "jobs": ", stats.total);
fmt.Println(""Scheduled": ", stats.scheduled);
fmt.Println(""Running": ", stats.running);
fmt.Println(""Completed": ", stats.completed);
fmt.Println(""Failed": ", stats.failed);
fmt.Println("Success rate:', stats.success_rate);
// Get statistics for all jobs in a product
var stats = await ductape.jobs.getStats({
});
Console.WriteLine('Total ["jobs"] = ", stats.total);
Console.WriteLine("["Scheduled"] = ", stats.scheduled);
Console.WriteLine("["Running"] = ", stats.running);
Console.WriteLine("["Completed"] = ", stats.completed);
Console.WriteLine("["Failed"] = ", stats.failed);
Console.WriteLine("Success rate:', stats.success_rate);
Retrying Failed Jobs
Retry a Failed Job
- TypeScript
- Java
- Go
- .NET
// Retry a failed job immediately
await ductape.jobs.retry('job_abc123');
// Retry with delay
await ductape.jobs.retry('job_abc123', {
delay: 60000 // Wait 1 minute before retrying
});
// Retry a failed job immediately
ductape.jobs.retry('job_abc123');
// Retry with delay
ductape.jobs.retry('job_abc123', Map.of(
"delay", 60000 // Wait 1 minute before retrying
));
// Retry a failed job immediately
client.jobs.retry('job_abc123');
// Retry with delay
client.jobs.retry('job_abc123', {
"delay": 60000 // Wait 1 minute before retrying
});
// Retry a failed job immediately
await ductape.jobs.retry('job_abc123');
// Retry with delay
await ductape.jobs.retry('job_abc123', {
["delay"] = 60000 // Wait 1 minute before retrying
});
Retry Multiple Failed Jobs
- TypeScript
- Java
- Go
- .NET
// Retry all failed jobs from today
await ductape.jobs.retryMany({
status: 'failed',
from: new Date().setHours(0, 0, 0, 0)
});
// Retry all failed jobs from today
ductape.jobs.retryMany(Map.of(
"status", "failed",
from: Instant.now().setHours(0, 0, 0, 0)
));
// Retry all failed jobs from today
client.jobs.retryMany({
"status": "failed",
from: new Date().setHours(0, 0, 0, 0)
});
// Retry all failed jobs from today
await ductape.jobs.retryMany({
["status"] = "failed",
from: DateTime.UtcNow.setHours(0, 0, 0, 0)
});
Deleting Jobs
Delete Completed Jobs
- TypeScript
- Java
- Go
- .NET
// Delete a specific job
await ductape.jobs.delete('job_abc123');
// Delete old completed jobs
await ductape.jobs.deleteMany({
status: 'completed',
to: Date.now() - 30 * 24 * 60 * 60 * 1000 // Older than 30 days
});
// Delete a specific job
ductape.jobs.delete('job_abc123');
// Delete old completed jobs
ductape.jobs.deleteMany(Map.of(
"status", "completed",
to: Date.now() - 30 * 24 * 60 * 60 * 1000 // Older than 30 days
));
// Delete a specific job
client.jobs.delete('job_abc123');
// Delete old completed jobs
client.jobs.deleteMany({
"status": "completed",
to: Date.now() - 30 * 24 * 60 * 60 * 1000 // Older than 30 days
});
// Delete a specific job
await ductape.jobs.delete('job_abc123');
// Delete old completed jobs
await ductape.jobs.deleteMany({
["status"] = "completed",
to: Date.now() - 30 * 24 * 60 * 60 * 1000 // Older than 30 days
});
Job Events and Webhooks
You can configure webhooks to receive notifications about job events:
- TypeScript
- Java
- Go
- .NET
// Configure job completion webhook
await ductape.jobs.setWebhook({
url: 'https://api.example.com/webhooks/jobs',
events: ['job.completed', 'job.failed'],
secret: 'webhook-secret-key'
});
// Configure job completion webhook
ductape.jobs.setWebhook(Map.of(
"url", "https://api.example.com/webhooks/jobs",
events: ['job.completed', 'job.failed'],
"secret", "webhook-secret-key"
));
// Configure job completion webhook
client.jobs.setWebhook({
"url": "https://api.example.com/webhooks/jobs",
events: ['job.completed', 'job.failed'],
"secret": "webhook-secret-key"
});
// Configure job completion webhook
await ductape.jobs.setWebhook({
["url"] = "https://api.example.com/webhooks/jobs",
events: ['job.completed', 'job.failed'],
["secret"] = "webhook-secret-key"
});
Webhook Events
| Event | Description |
|---|---|
job.scheduled | Job was scheduled |
job.started | Job execution started |
job.completed | Job completed successfully |
job.failed | Job failed (after retries) |
job.cancelled | Job was cancelled |
job.paused | Recurring job was paused |
job.resumed | Paused job was resumed |
Webhook Payload
interface IJobWebhookPayload {
event: string;
timestamp: number;
job: {
id: string;
status: string;
namespace: string;
product: string;
env: string;
scheduled_at: number;
execution_count?: number;
error?: string;
};
}
Best Practices
1. Use Meaningful Job IDs
When retrieving the job ID from dispatch, store it with context:
- TypeScript
- Java
- Go
- .NET
const job = await ductape.api.dispatch({ ... });
// Store job reference with context
await saveJobReference({
job_id: job.job_id,
purpose: 'welcome_email',
user_id: userId,
created_at: Date.now()
});
Map<String, Object> job = ductape.api().dispatch(Map<String, Object>.of(
... ));
// Store job reference with context
saveJobReference(Map.of(
job_id: job.job_id,
"purpose", "welcome_email",
user_id: userId,
created_at: Date.now()
));
import "context"
job := client.Api.Dispatch(ctx, map[string]any{
... });
// Store job reference with context
saveJobReference({
job_id: job.job_id,
"purpose": "welcome_email",
user_id: userId,
created_at: Date.now()
});
var job = await await ductape.Api.DispatchAsync(new Dictionary<string, object?>
{
... });
// Store job reference with context
await saveJobReference({
job_id: job.job_id,
["purpose"] = "welcome_email",
user_id: userId,
created_at: Date.now()
});
2. Monitor Critical Jobs
Set up alerts for critical job failures:
- TypeScript
- Java
- Go
- .NET
const job = await ductape.jobs.get('job_abc123');
if (job.status === 'failed') {
await alertOps({
message: `Critical job ${job.id} failed: ${job.last_error}`,
severity: 'high'
});
}
Map<String, Object> job = ductape.jobs.get('job_abc123');
if (job.status === 'failed') Map.of(
alertOps(Map.of(
message: `Critical job $Map.of(job.id) failed: $Map.of(job.last_error)`,
"severity", "high"
));
)
job := client.jobs.get('job_abc123');
if (job.status === 'failed') {
alertOps({
message: `Critical job ${job.id} failed: ${job.last_error}`,
"severity": "high"
});
}
var job = await ductape.jobs.get('job_abc123');
if (job.status === 'failed') {
await alertOps({
message: `Critical job ${job.id} failed: ${job.last_error}`,
["severity"] = "high"
});
}
3. Clean Up Old Jobs
Regularly clean up completed jobs to manage storage:
- TypeScript
- Java
- Go
- .NET
// Run monthly cleanup
await ductape.jobs.deleteMany({
status: ['completed', 'cancelled', 'failed'],
to: Date.now() - 90 * 24 * 60 * 60 * 1000 // Older than 90 days
});
// Run monthly cleanup
ductape.jobs.deleteMany(Map.of(
status: ['completed', 'cancelled', 'failed'],
to: Date.now() - 90 * 24 * 60 * 60 * 1000 // Older than 90 days
));
// Run monthly cleanup
client.jobs.deleteMany({
status: ['completed', 'cancelled', 'failed'],
to: Date.now() - 90 * 24 * 60 * 60 * 1000 // Older than 90 days
});
// Run monthly cleanup
await ductape.jobs.deleteMany({
status: ['completed', 'cancelled', 'failed'],
to: Date.now() - 90 * 24 * 60 * 60 * 1000 // Older than 90 days
});
4. Use Pausing for Maintenance
Pause jobs during system maintenance:
- TypeScript
- Java
- Go
- .NET
// Before maintenance
await ductape.jobs.pauseMany({});
// ... perform maintenance ...
// After maintenance
await ductape.jobs.resumeMany({
status: 'paused'
});
// Before maintenance
ductape.jobs.pauseMany(Map.of());
// ... perform maintenance ...
// After maintenance
ductape.jobs.resumeMany(Map.of(
"status", "paused"
));
// Before maintenance
client.jobs.pauseMany({});
// ... perform maintenance ...
// After maintenance
client.jobs.resumeMany({
"status": "paused"
});
// Before maintenance
await ductape.jobs.pauseMany({});
// ... perform maintenance ...
// After maintenance
await ductape.jobs.resumeMany({
["status"] = "paused"
});
See Also
- Scheduling Jobs - Create and schedule jobs
- Retry Strategies - Handle job failures
- Examples - Real-world job management patterns