Skip to content

Commit

Permalink
Merge branch 'main' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
forgetso committed Jan 8, 2025
2 parents db8c113 + 89150a7 commit 0af5a39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/provider/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export async function checkIfTaskIsRunning(
taskName,
ScheduledTaskStatus.Running,
);
if (runningTask) {
const twoMinutesAgo = new Date().getTime() - 1000 * 60 * 2
// If the task is running and the task was started within the last 2 minutes
// TODO: This is a temporary fix to prevent failed tasks from blocking the next task
if (runningTask && runningTask.datetime > twoMinutesAgo) {
const completedTask = await db.getScheduledTaskStatus(
runningTask._id as ObjectId,
ScheduledTaskStatus.Completed,
Expand Down

0 comments on commit 0af5a39

Please sign in to comment.