Closed candu closed 4 years ago
Hit a couple of midsize challenges here.
First was authentication: to relate jobs to users, scheduler
needed to share user sessions with web
, which meant moving that out of its in-memory store in web
and into database.
Second was timestamp handling: pg-boss
uses TIMESTAMP WITH TIME ZONE
columns, whereas MOVE uses TIMESTAMP WITHOUT TIME ZONE
with the convention that all timestamps are jurisdiction-local. This meant adding a new set of types and validators to handle pg-boss
timestamps.
Total impact here was roughly a day of work - though the tasks here did take into account a bit of unexpected additional time, so this isn't problematic by any means.
Description
554 and #555 form the basis for implementing
scheduler
on top ofpg-boss
(or, if needed, other tools). This task starts the actual implementation by creating a hierarchy of job-type-specific executor classes, and by integratingpg-boss
withinJobController
.Acceptance Criteria
BackgroundJobBase
, and create a new classBackgroundJobTest
that extends it;public
to store progress stats, links, etc., and that refers to job IDs as well as user IDs;JobMetadataDAO
with CRUD methods on this table;JobMetadataDAO
methods inJobMetadataDAO.spec.js
;JobController
endpoints:pg-boss
job with given data and a newJobMetadata
record that links to it;pg-boss
job by job ID;pg-boss
job andJobMetadata
record by job ID;BackgroundJobGenerateReport
:(type, id, format)
tuples;JobMetadata
record to reflect progress;Additional Notes Note that
pg-boss
initialization will need to be integrated withtest:db-startup
scripts at this point - totally doable, and should build off similar parts of #555 .