Skip to content

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

Closed

Description

@jtniehof

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

Activity

  1. added
    enhancement
    on Aug 10, 2021
  2. jtniehof commented on Aug 10, 2021

    @jtniehof
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions