jonthornton / MTAPI

JSON proxy server for the MTA's realtime New York City subway feed
281 stars 84 forks source link

Fix for running in THREADED=False mode #8

Closed mattsahn closed 7 years ago

mattsahn commented 7 years ago

Running with THREADED=False causes an error because 'threader' attribute won't exist when it gets checked in. Made a small change to add _THREADED attribute to the Mtapi object and check it first in the is_expired() function where it was failing when not running in threaded mode.

File "/home/ubuntu/workspace/app.py", line 106, in by_route

File "/home/ubuntu/workspace/mtapi/mtapi.py", line 196, in get_by_route

File "/home/ubuntu/workspace/mtapi/mtapi.py", line 215, in is_expired

AttributeError: 'Mtapi' object has no attribute 'threader'

jonthornton commented 7 years ago

Thanks!