Skip to content

Commit 29410aa

Browse files
authored
fix: claim payments for jobs without jobIdHash (#1293)
1 parent 3910376 commit 29410aa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/components/database/sqliteCompute.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '../../@types/C2D/C2D.js'
77
import sqlite3, { RunResult } from 'sqlite3'
88
import { DATABASE_LOGGER } from '../../utils/logging/common.js'
9+
import { create256Hash } from '../../utils/crypt.js'
910

1011
interface ComputeDatabaseProvider {
1112
newJob(job: DBComputeJob): Promise<string>
@@ -530,6 +531,9 @@ export class SQLiteCompute implements ComputeDatabaseProvider {
530531
const maxJobDuration = row.expireTimestamp
531532
delete row.expireTimestamp
532533
const job: DBComputeJob = { ...row, ...body, maxJobDuration }
534+
if (!job.jobIdHash && job.jobId) {
535+
job.jobIdHash = create256Hash(job.jobId)
536+
}
533537
return job
534538
})
535539
resolve(all)

0 commit comments

Comments
 (0)