Skip to content
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

Use exit code of printProcessQueue to indicate if the queue is empty #87

Closed
jtniehof opened this issue Aug 10, 2021 · 1 comment · Fixed by #88
Closed

Use exit code of printProcessQueue to indicate if the queue is empty #87

jtniehof opened this issue Aug 10, 2021 · 1 comment · Fixed by #88
Labels
enhancement New feature or feature request

Comments

@jtniehof
Copy link
Member

It's useful to be able to, in automated processing, take different actions based on whether there's anything in the process queue (e.g. skip processing if nothing got ingested.) printProcessQueue gives that information, but it's hard to check that programmatically.

Proposed enhancement

printProcessQueue should take a flag (letter TBD). Iff this flag is set, set the exit code: 0 if there's something in the process queue (by analogy with grep), and 1 if it's empty.

Possible flag name: -q for quiet (and then only set exit status, don't print...although maybe we want the ability to print output and also set exit status?)

Alternatives

magically grepping the output

OS, Python version, and dependency version information:

Linux-4.15.0-153-generic-x86_64-with-Ubuntu-18.04-bionic
sys.version_info(major=2, minor=7, micro=17, releaselevel='final', serial=0)
sqlalchemy=1.1.11

Version of dbprocessing

Current github master

Closure condition

Close when merge a commit with the suggested flag

@jtniehof jtniehof added the enhancement New feature or feature request label Aug 10, 2021
@jtniehof
Copy link
Member Author

Also possibly a flag for "count" that just dumps the number of files in the process queue to stdout (easier to parse than grepping the detail)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant