MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / clearActiveRun

Function clearActiveRun

src/index.js:992–996  ·  view source on GitHub ↗
(sessionID)

Source from the content-addressed store, hash-verified

990}
991
992function dueJobs(state, force = false) {
993 const current = now()
994 return (state.jobs || []).filter((job) => {
995 if (isGoalJob(job) && ["completed", "blocked", "cleared"].includes(job.goalStatus)) return false
996 if (!job.enabled || job.paused) return false
997 if (job.maxRuns > 0 && (job.runCount || 0) >= job.maxRuns) return false
998 if (job.maxRuntimeMs > 0 && current - Date.parse(job.createdAt || new Date().toISOString()) >= job.maxRuntimeMs) return true
999 if (force) return true

Callers 3

finalizeActiveRunFunction · 0.85
maybeRunDueJobsFunction · 0.85
stopLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected