Skip to content

Commit

Permalink
Merge pull request #17 from golemfactory/JST-751/combine-taskTimeout-…
Browse files Browse the repository at this point in the history
…and-activityExecutionTimeout

JST-751: Combine `taskTimeout` and `activityExecuteTimeout`
  • Loading branch information
mgordel authored Mar 6, 2024
2 parents f8ad80a + b7aea90 commit 05d8671
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions examples/proxy/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { TaskExecutor, pinoPrettyLogger } from "@golem-sdk/task-executor";
maxTaskRetries: 5,

// If you're using TaskExecutor, you want the "task" to last long in that case
taskTimeout: 60 * 60 * 1000,
activityExecuteTimeout: 60 * 60 * 1000,
taskTimeout: 60 * 60 * 1000, // 60 minutes
});

try {
Expand Down
3 changes: 2 additions & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ export class TaskConfig extends ActivityConfig {
public readonly logger: Logger;

constructor(options?: TaskServiceOptions) {
super(options);
const activityExecuteTimeout = options?.activityExecuteTimeout || options?.taskTimeout || DEFAULTS.taskTimeout;
super({ ...options, activityExecuteTimeout });
this.maxParallelTasks = options?.maxParallelTasks || DEFAULTS.maxParallelTasks;
this.taskRunningInterval = options?.taskRunningInterval || DEFAULTS.taskRunningInterval;
this.taskTimeout = options?.taskTimeout || DEFAULTS.taskTimeout;
Expand Down
2 changes: 1 addition & 1 deletion src/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const terminatingSignals = ["SIGINT", "SIGTERM", "SIGBREAK", "SIGHUP"];
export type ExecutorOptions = {
/** Image hash or image tag as string, otherwise Package object */
package?: string | Package;
/** Timeout for execute one task in ms */
/** Timeout for execute one task in ms. Default is 300_000 (5 minutes). */
taskTimeout?: number;
/** Subnet Tag */
subnetTag?: string;
Expand Down

0 comments on commit 05d8671

Please sign in to comment.