-
Notifications
You must be signed in to change notification settings - Fork 8
Fix 462 #463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Fix 462 #463
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
13bdbc0
Single method to get and set the upload status in db.
gusmith bbadadd
4 states for uploaded in the dataprovider table.
gusmith 784ef41
Use the state `done` instead of the boolean TRUE.
gusmith 3d8890b
Two new tests related to this new feature.
gusmith 56b5fc1
The main change when posting clks to a project, check that we can pos…
gusmith 104f49e
Tiny cleanup of a variable.
gusmith 08fc85b
Some comments in the tests.
gusmith db74fc0
Update changelo
gusmith 0680f36
Typo in changelog
gusmith 83263ba
Clean test and modifying variable name.
gusmith 5474008
Rename method to update upload state and add nicer documentation.
gusmith ce02a82
Change dur to remanimg
gusmith 13e65da
Rename the test methods to be more explicit.
gusmith e5a7b7b
Rename an enum and add documentation about them.
gusmith 3a30ad2
Typos.
gusmith 7216f31
Rename again a test method.
gusmith 6a68f18
Documentation correction from PR review.
gusmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 states for uploaded in the dataprovider table.
- not_started when we haven't started uploading the clks - in_progress when we start uploading them (lock the resource) - done when completed - error when an error occured.
- Loading branch information
commit bbadaddf56c4f66331730766b2b02d745ee89645
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,12 @@ RETURNS bool AS $$ | |
| SELECT $1.state = 'completed' | ||
| $$ STABLE LANGUAGE SQL; | ||
|
|
||
| CREATE TYPE UPLOADEDSTATE AS ENUM ( | ||
| 'not_started', | ||
| 'in_progress', | ||
| 'done', | ||
| 'error' | ||
| ); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
|
|
||
| CREATE TABLE dataproviders ( | ||
| id SERIAL PRIMARY KEY, | ||
|
|
@@ -93,7 +99,7 @@ CREATE TABLE dataproviders ( | |
| token CHAR(48) NOT NULL UNIQUE, | ||
|
|
||
| -- Set after the bloom filter data has been added | ||
| uploaded BOOL NOT NULL DEFAULT FALSE, | ||
| uploaded UPLOADEDSTATE NOT NULL, | ||
|
|
||
| project CHAR(48) REFERENCES projects (project_id) on DELETE CASCADE | ||
| ); | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, now we have
UPLOADEDSTATEandUPLOADSTATE. This is very confusing.After looking at those for a bit, I think we should rename
UPLOADSTATEtoPROCESSEDSTATE.It would also be nice to add a bit of an explanation what all those states are for.
In my view,
UPLOADSTATE describes the state of the processing of the uploaded clks. This is only set after CLKs have been uploaded. 'pending' means we are waiting for some processing to be done, 'ready' means done and 'error' if something fails.
UPLOADEDSTATE describes the state of the CLK upload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was indeed a pickle. I will add comments on the
UPLOADEDSTATE.I didn't want to touch the
UPLOADSTATEas I wasn't sure what it was made for (as you mentioned, this is not well documented). But I'll also add some documentation around it and rename it. In which case I will also renameUPLOADEDSTATEtoUPLOADSTATEwhich sounds better :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll finally keep
UPLOADEDSTATEinstead of renaming it because the value in the table isuploaded. But renamed theUPLOADSTATEtoPROCESSEDSTATE, adding some documentation.