proletarian

emccue 2023-03-31T17:47:44.169179Z

this might sound dumb - but im considering using proletariat's job table in...perhaps a strange way

emccue 2023-03-31T17:48:11.783359Z

specifically, on a trigger from another table inserting a job for proletarian to pick up

István Karaszi 2024-06-05T17:11:33.505229Z

I need to do exactly the same

István Karaszi 2024-06-05T17:11:47.324049Z

I ran into this problem, unfortunately: https://github.com/msolli/proletarian/issues/22

emccue 2023-03-31T17:48:56.516209Z

CREATE TABLE IF NOT EXISTS job (
    job_id      UUID PRIMARY KEY,   -- job id, generated and returned by proletarian.job/enqueue!
    queue       TEXT      NOT NULL, -- queue name
    job_type    TEXT      NOT NULL, -- job type
    payload     TEXT      NOT NULL, -- Transit-encoded job data
    attempts    INTEGER   NOT NULL, -- Number of attempts. Starts at 0. Increments when the job is processed.
    enqueued_at TIMESTAMP NOT NULL, -- When the job was enqueued (never changes)
    process_at  TIMESTAMP NOT NULL  -- When the job should be run (updates every retry)
);
I can edit this sql to make it a little easier on my end (default time on enqueued and processe_at and default value on attempts + job_id)

emccue 2023-03-31T17:49:10.819469Z

but the thing im kinda going.eeerg on is the payload

emccue 2023-03-31T17:49:33.925099Z

its pretty easy to make json in postgres for the job data, but if that json is "~" then its not valid transit

emccue 2023-03-31T17:49:45.469179Z

which is such a dumb edge case but im thinking about it

emccue 2023-03-31T17:50:06.459959Z

because it would mean that hypothetically putting a ~ at the start of some random fields would be a hidden bug

emccue 2023-03-31T17:50:31.595639Z

and I almost want to ask if there is a way i could mark that the payload is actually json encoded

emccue 2023-03-31T18:00:22.928709Z

you know what, :proletarian/serializer might be the thing. Just need to always use json

👍 1