File size: 408 Bytes
03b405b
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
const { getDb } = require("../config/db");
const { nowIso } = require("../utils/time");

function recoverInterruptedJobs() {
  getDb().prepare(`
    UPDATE jobs
    SET status = 'retrying', stage = 'recovered', updated_at = ?
    WHERE status IN ('downloading', 'validating', 'probing', 'planning', 'splitting', 'compressing', 'uploading')
  `).run(nowIso());
}

module.exports = { recoverInterruptedJobs };