ncssar / sartopo_python

Python calls for the caltopo / sartopo API
GNU General Public License v3.0
14 stars 2 forks source link

stop sync when calling program terminates #19

Closed caver456 closed 3 years ago

caver456 commented 3 years ago

right now, sync continues after the calling program (e.g. sartopo_address) is closed normally.

caver456 commented 3 years ago

after looking into threading more, two main improvements were made: 1) don't create a new thread on each sync interval - just make one sync thread; 2) have that thread target (doSync) call itself recursively on an interval, as long as the main thread is still alive by testing threading.main_thread().is_alive()