Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
hishizuka committed Jan 3, 2024
1 parent c3a4e60 commit b679c24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class Config:
"HAVE_API_TOKEN": False,
"SERVER": "demo.thingsboard.io",
"TOKEN": "",
"INTERVAL_SEC": 120,
"INTERVAL_SEC": 180,
}

# IMU axis conversion
Expand Down
8 changes: 2 additions & 6 deletions modules/helper/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,16 @@ async def download_worker(self):
res = None
try:
await self.open_bt_tethering(f_name)
# app_logger.info(f"start download files({len(q['urls'])}), {q['urls'][0]} / {self.download_queue.qsize()}")
res = await download_files(**q)
# app_logger.info(res)
self.download_queue.task_done()
except concurrent.futures._base.CancelledError:
return

# all False -> give up
if not any(res) or res is None:
failed.append((datetime.now(), q))
app_logger.error(f"failed download ({len(q['urls'])}), {bool(detect_network())}")
app_logger.debug(q["urls"])
app_logger.error(f"failed download ({len(q['urls'])}), network: {bool(detect_network())}")
app_logger.error(q["urls"])
# retry
elif not all(res) and len(q["urls"]) and len(q["urls"]) == len(res):
retry_urls = []
Expand Down Expand Up @@ -297,9 +295,7 @@ async def open_bt_tethering(self, f_name):
app_logger.error(f"[BT] connect error, network: {bool(detect_network())}({count}s), f_name: {f_name}")
return False

# app_logger.debug(f"bt_pan_status:{bt_pan_status}, {detect_network()}")
await asyncio.sleep(5)

app_logger.info(f"[BT] connect, network: {bool(detect_network())}({count}s), f_name: {f_name}")

return True
Expand Down

0 comments on commit b679c24

Please sign in to comment.