Skip to content

Instantly share code, notes, and snippets.

@tomredsky
Created January 29, 2020 16:31
Show Gist options
  • Save tomredsky/0f99d14d409df5cf89d273572ca3dfdf to your computer and use it in GitHub Desktop.
Save tomredsky/0f99d14d409df5cf89d273572ca3dfdf to your computer and use it in GitHub Desktop.
create type queue_status as enum('new', 'inprogress', 'done');
create table delivery_queue (
delivery_id int not null primary key references dl (id) on delete cascade,
date_entered timestamp not null default current_timestamp,
status queue_status not null default 'new'
);
@robrwo
Copy link

robrwo commented Jan 29, 2020

If the queue uses delivery_id, then aren't we expecting that there will be a delivery note for website uploads?

@tomredsky
Copy link
Author

If the queue uses delivery_id, then aren't we expecting that there will be a delivery note for website uploads?

There is a dl record for every web download. Is that what you mean?

@tomredsky
Copy link
Author

I'd add a "failed" to the queue_status.

Good shout. For the record, I was not sure about done but I envisage the row being deleted once the ExportMedia::S3 had done it's thing.

@robrwo
Copy link

robrwo commented Jan 29, 2020

There is a dl record for every web download. Is that what you mean?

If there is, then why did I do all that work to rewrite the S3 code to not rely on a delivery note?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment