Light clean: add C# implementation, tests, and fix things!#8
Light clean: add C# implementation, tests, and fix things!#8nathanwl88 wants to merge 7 commits intomainfrom
Conversation
Data is only removed if items are completed. Therefore items without data should not be added back to the queue.
JOT85
left a comment
There was a problem hiding this comment.
This PR has become more of a "add tests for weird cleaning cases" then "make sure everything works in weird cases"... I think we're mostly good. I still need to add tests for the Node.js implementation of light clean, and the dotnet implementation is failing the tests, but the Python one seems to work!
See my comment on line 218-220 above.
Python + dotnet only
Python cleaner
./run-test.sh -t python_jobs,dotnet_jobsPassing
Dotnet cleaner
./run-test.sh -t python_jobs,dotnet_jobs -c ./dotnet-cleaner/run.shFailing
Full tests
Python cleaner
./run-test.sh -t go_jobs,python_jobs,rust_jobs,node_jobs,dotnet_jobs -c ./dotnet-cleaner/run.shPassing
Dotnet cleaner
./run-test.sh -t go_jobs,python_jobs,rust_jobs,node_jobs,dotnet_jobs -c ./dotnet-cleaner/run.shFailing
| //FreeRedis LPos always returns a long | ||
| //need to confirm if -1 is returned in place of NIL | ||
| if (DataExists(db, item_id) && db.LPos(MainQueueKey, item_id) < 0 && db.LPos(ProcessingKey, item_id) < 0) |
There was a problem hiding this comment.
I suspect LPos might return 0 if the response is nil... Which makes it impossible to use this method to determine if the item is in the queue...
The tests are failing (for a simple case that only requires Python and dotnet, and uses the dotnet cleaning, from within the tests directory, run ./run-test.sh -t python_jobs,dotnet_jobs -c ./dotnet-cleaner/run.sh) and I think this is the reason it fails 😞
|
Superseded by #11 |
Added light clean for C# so it can be ran inside a C# web job.