mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-07-16 11:38:47 -04:00
make drain-queue output actual json instead of python dict syntax
This commit is contained in:
parent
fe1d9e01eb
commit
2ab767eaa9
1 changed files with 4 additions and 1 deletions
|
@ -31,7 +31,10 @@ logging.basicConfig(stream=sys.stderr, level=args.log_level,
|
|||
format='%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s')
|
||||
|
||||
def print_and_maybe_ack(body, message):
|
||||
print(body)
|
||||
# do this instead of print(body) so that output syntax is json, not python
|
||||
# dict (they are similar but not identical)
|
||||
print(message.body.decode('utf-8'))
|
||||
|
||||
if not args.no_ack:
|
||||
message.ack()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue