mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-04-18 01:53:47 +08:00
fix: replace bare except clauses with except Exception
Bare `except:` catches BaseException including KeyboardInterrupt and SystemExit. Replaced 29 instances with `except Exception:`.
This commit is contained in:
@@ -147,7 +147,7 @@ class SchedulerService:
|
||||
return False
|
||||
|
||||
return now >= next_run
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def _calculate_next_run(self, task: dict, from_time: datetime) -> Optional[datetime]:
|
||||
@@ -195,7 +195,7 @@ class SchedulerService:
|
||||
# Only return if in the future
|
||||
if run_at > from_time:
|
||||
return run_at
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user