TrendRadar icon indicating copy to clipboard operation
TrendRadar copied to clipboard

Fix: Reload config on each run to support Docker config changes

Open tennisleng opened this issue 1 month ago • 0 comments

Fixes issue #163 where config.yaml modifications were not picked up in Docker deployments

Problem

In Docker deployments (especially on Feiniu NAS), config.yaml changes were not being read because the CONFIG was loaded once at module import time and cached throughout the process lifetime.

Solution

  • Move CONFIG loading from module level to main() function so config is reloaded on each execution
  • Add early return in run() method when crawler is disabled to prevent unnecessary processing
  • This ensures Docker cron jobs pick up config changes on each run

Testing

  • Verified config changes are now picked up on each run
  • Confirmed enable_crawler=false properly disables crawling without running data fetch operations
  • All other config options (report mode, push window, webhooks, etc.) are now reloadable

Resolves: https://github.com/sansan0/TrendRadar/issues/163

tennisleng avatar Nov 12 '25 01:11 tennisleng