Skip to content

fix: check daily if update is due based on UPDATE_INTERVAL#303

Open
aaronspruit wants to merge 2 commits intortuszik:devfrom
aaronspruit:fix-updates
Open

fix: check daily if update is due based on UPDATE_INTERVAL#303
aaronspruit wants to merge 2 commits intortuszik:devfrom
aaronspruit:fix-updates

Conversation

@aaronspruit
Copy link
Copy Markdown

Originally updates would only be checked if they need to happen based on the duration of UPDATE_INTERVAL. This means that if the container is restarted, it resets the timer.

This change compares the timestamp on DATA_DIR/.photon-index-updated to the UPDATE_INTERVAL on a daily basis.

I believe this was the originally intended functionality, as by default it means the container needs to be running for 30 days before an update is even attempted...instead of doing updates every UPDATE_INTERVAL.

I was very confused as to why my service hadn't updated when the last time it did so was Feb 17th and UPDATE_INTERVAL=30d (even with bouncing the container). This fix correctly identified that today it's 45 days out of date and did the update.

$ task check
task: [deadcode] uv run vulture --min-confidence 100 --exclude ".venv" .
task: [format] uv run ruff format
task: [lint] uv run ruff check --fix
task: [typecheck] uv run ty check
All checks passed!
17 files left unchanged
All checks passed!

$ task test
task: [test] uv run pytest
================================================= test session starts =================================================
platform linux -- Python 3.13.12, pytest-9.0.2, pluggy-1.6.0
rootdir: /mnt/c/Users/rebel/repos/photon-docker
configfile: pyproject.toml
plugins: cov-7.0.0
collected 36 items                                                                                                    

tests/utils/test_regions.py ...................                                                                 [ 52%]
tests/utils/test_sanitize.py ......                                                                             [ 69%]
tests/utils/test_validate_config.py ...........                                                                 [100%]

================================================= 36 passed in 2.99s ==================================================

@aaronspruit aaronspruit changed the title fix: check if update is due daily based on UPDATE_INTERVAL fix: check daily if update is due based on UPDATE_INTERVAL Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant