vans163
04/11/2021, 7:19 PMvans163
04/11/2021, 7:19 PMvans163
04/11/2021, 9:41 PMvans163
04/11/2021, 9:41 PMvans163
04/11/2021, 9:41 PMvans163
04/11/2021, 9:42 PMvans163
04/11/2021, 9:42 PMvans163
04/11/2021, 10:06 PMvans163
04/11/2021, 10:06 PMvans163
04/11/2021, 10:06 PMvans163
04/11/2021, 10:07 PMvans163
04/11/2021, 10:18 PMvans163
04/11/2021, 10:25 PMvans163
04/11/2021, 10:25 PMvans163
04/11/2021, 10:25 PMvans163
04/11/2021, 10:26 PMvans163
04/11/2021, 10:26 PMvans163
04/11/2021, 10:26 PMvans163
04/11/2021, 10:57 PMjavascript
async get_jobs_by_filter({queued, in_progress, finished, failed}, page, limit, acc, offset) {
offset = offset || 0
acc = acc || []
var objects = await this.storage.list({start: offset, limit: 1000})
var jobs = objects.values.filter(job=> {
if (queued && job.status == "queued")
return true;
if (in_progress && job.status == "in_progress")
return true;
if (finished && job.status == "done")
return true;
if (failed && job.status == "error")
return true;
return false
})
acc = acc.concat(jobs);
//abort early
var skip = page*limit
if (acc.length >= skip+limit) {
return acc.slice(skip, limit)
}
if (objects.size == 1000) {
return get_jobs_by_filter({queued, in_progress, finished, failed}, page, limit, acc, offset + 1000)
} else {
return acc.slice(skip, limit)
}
}
vans163
04/11/2021, 10:58 PMvans163
04/11/2021, 11:03 PMvans163
04/11/2021, 11:03 PMluke
04/12/2021, 1:25 AMluke
04/12/2021, 2:13 AM__STATIC_CONTENT is not defined
. kv-asset-handler seems to depend on some globals that are available in the webpack environment but not javascript + modules format for some reason. is this something i can resolve on my own, or is there magic happening behind the scenes?luke
04/12/2021, 2:30 AMluke
04/12/2021, 3:10 AM__STATIC_CONTENT
is passed through the env
argument for module workersluke
04/12/2021, 4:30 AMenv
instead, I now get the error: there is no KV namespace bound to the script
, so I think something behind the scenes may have to change.luke
04/12/2021, 4:30 AMenv.__STATIC_CONTENT
is defined, but it's an empty object.GrygrFlzr
04/12/2021, 11:43 AMPhilipA
04/12/2021, 11:56 AM