casmlab / purpletag

Calculate political polarization scores for members of U.S. Congress based on their tweets
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

when using track option, stream stalls and dies #19

Open libbyh opened 6 years ago

libbyh commented 6 years ago

Here's the error I got:

Traceback (most recent call last):
  File "/home/libbyh/anaconda3/envs/purpletag/bin/purpletag-collect", line 11, in <module>
    load_entry_point('purpletag==0.1.4', 'console_scripts', 'purpletag-collect')()
  File "/home/libbyh/anaconda3/envs/purpletag/lib/python2.7/site-packages/purpletag-0.1.4-py2.7.egg/purpletag/purpletag_collect.py", line 84, in main
    track_users(ids)
  File "/home/libbyh/anaconda3/envs/purpletag/lib/python2.7/site-packages/purpletag-0.1.4-py2.7.egg/purpletag/purpletag_collect.py", line 40, in track_users
    for tweet in twutil.collect.track_user_ids(ids):
  File "/home/libbyh/anaconda3/envs/purpletag/lib/python2.7/site-packages/TwitterAPI/TwitterAPI.py", line 305, in __iter__
    for item in self._iter_stream():
  File "/home/libbyh/anaconda3/envs/purpletag/lib/python2.7/site-packages/TwitterAPI/TwitterAPI.py", line 280, in _iter_stream
    raise TwitterConnectionError('Twitter stream stalled')
TwitterAPI.TwitterError.TwitterConnectionError: Twitter stream stalled

Not sure how long into tracking this happened. -collect option worked fine.

libbyh commented 6 years ago

Looks like it happens if you're running a --collect at the same time with the same credentials. Should allow multiple keys or at least recover gracefully.

libbyh commented 6 years ago

Happened again today but no other process was running.