Skip to content

Commit

Permalink
log when INT/TERM is received
Browse files Browse the repository at this point in the history
log if message is discarded
  • Loading branch information
kngenie committed Jul 27, 2018
1 parent 709ee98 commit f71eba9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion twitter/setup.py
Expand Up @@ -2,7 +2,7 @@

setup(
name="twitter-archiver",
version="0.3.2.1",
version="0.3.2.2",
author="Kenji Nagahashi",
author_email="kenji@archive.org",
packages=find_packages(),
Expand Down
3 changes: 3 additions & 0 deletions twitter/tweetwarc.py
Expand Up @@ -207,6 +207,7 @@ def close(self):

interrupted = False
def interrupt(sig, stack):
logging.info('received signal %s', sig)
global interrupted
interrupted = True

Expand Down Expand Up @@ -250,6 +251,8 @@ def interrupt(sig, stack):
logging.info('pausing 5 seconds before continueing')
time.sleep(5.0)
break
else:
logging.info('discarded %s/%s', msg.partition, msg.offset)

# app termination is checked only after each tweet is archived
# to ensure all tweets are archived.
Expand Down

0 comments on commit f71eba9

Please sign in to comment.