def _should_continue():
min_check_interval = 3600 * 24
update_timestamp_file = os.path.join(tempfile.gettempdir(), 'uavcan_gui_tool', 'update_check_timestamp')
try:
with open(update_timestamp_file, 'r') as f:
update_check_timestamp = float(f.read().strip())
except Exception:
logger.debug('Update timestamp file could not be read', exc_info=True)
update_check_timestamp = 0
if (time.time() - update_check_timestamp) < min_check_interval:
return False
try:
os.makedirs(os.path.dirname(update_timestamp_file))
except Exception:
pass # Nobody cares.
with open(update_timestamp_file, 'w') as f:
f.write(str(time.time()))
return True
评论列表
文章目录