Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Db store #98

Merged
merged 10 commits into from
Dec 18, 2023
Merged

Add Db store #98

merged 10 commits into from
Dec 18, 2023

Conversation

quentinql
Copy link
Collaborator

Add a dbstore that store the 10 lasts probe results (use peewee ORM)

The db store:
- at init, creates 10 fake results if they don't exists for each probes
- a thread store each minutes all probe states (replace the older probe state with the new)

KNOWN BUG: trio doesn't correctly handle signals so the clean shutdown of the thread could cause some obscur error in logs (but before there was not a proper shutdown so now we have a proper db write (not file write) and we just have in addition a weird error in the logs if we cancel the run)

@quentinql quentinql force-pushed the dvl/quentin/dbstore branch 5 times, most recently from 2dd37d7 to 0dcac8f Compare December 11, 2023 11:01
timon/db/serializers.py Outdated Show resolved Hide resolved
timon/db/serializers.py Outdated Show resolved Hide resolved
timon/db/serializers.py Outdated Show resolved Hide resolved
timon/db/models.py Outdated Show resolved Hide resolved
Copy link
Contributor

@klausfmh klausfmh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor feedback +
add get

  • add tests

timon/tests/test_db.py Outdated Show resolved Hide resolved
timon/tests/test_db.py Outdated Show resolved Hide resolved
timon/tests/test_db.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/conf/config.py Outdated Show resolved Hide resolved
timon/db/backends.py Outdated Show resolved Hide resolved
timon/db/peewee_utils.py Outdated Show resolved Hide resolved
timon/db/peewee_utils.py Outdated Show resolved Hide resolved
timon/db/peewee_utils.py Outdated Show resolved Hide resolved
@feenes feenes merged commit 25b431d into master Dec 18, 2023
14 checks passed
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.

3 participants