@@ -7,6 +7,13 @@ import { runVerificationJob } from '#route.verify.ts'
77
88const logger = getLogger ( [ 'tempo' , 'job-runner' ] )
99
10+ type LegacyStoredJob = Pick <
11+ VerificationJob ,
12+ 'jobId' | 'chainId' | 'address'
13+ > & {
14+ body : Omit < VerificationJob , 'jobId' | 'chainId' | 'address' >
15+ }
16+
1017export class VerificationJobRunner extends DurableObject < Cloudflare . Env > {
1118 async enqueue ( job : VerificationJob ) : Promise < void > {
1219 logger . info ( 'job_enqueued' , {
@@ -20,12 +27,27 @@ export class VerificationJobRunner extends DurableObject<Cloudflare.Env> {
2027 }
2128
2229 override async alarm ( ) : Promise < void > {
23- const job = await this . ctx . storage . get < VerificationJob > ( 'job' )
24- if ( ! job ) {
30+ const storedJob = await this . ctx . storage . get <
31+ VerificationJob | LegacyStoredJob
32+ > ( 'job' )
33+ if ( ! storedJob ) {
2534 logger . warn ( 'alarm_job_missing' )
2635 return
2736 }
2837
38+ const job =
39+ 'body' in storedJob
40+ ? {
41+ jobId : storedJob . jobId ,
42+ chainId : storedJob . chainId ,
43+ address : storedJob . address ,
44+ stdJsonInput : storedJob . body . stdJsonInput ,
45+ compilerVersion : storedJob . body . compilerVersion ,
46+ contractIdentifier : storedJob . body . contractIdentifier ,
47+ creationTransactionHash : storedJob . body . creationTransactionHash ,
48+ }
49+ : storedJob
50+
2951 logger . info ( 'job_started' , {
3052 jobId : job . jobId ,
3153 chainId : job . chainId ,
0 commit comments