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

Only load and parse pollfile if it has changed since last loading #327

Conversation

johannaengland
Copy link
Contributor

@johannaengland johannaengland commented Jul 26, 2024

Scope and purpose

Fixes #282. Dependent on #345.

Add a description of what this PR does and why it is needed. If a linked ticket(s) fully
cover it, you can omit this.

Contributor Checklist

Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to Zino can be found in the
README.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with black, ruff and isort, easiest by using pre-commit
  • The first line of the commit message continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.27%. Comparing base (19ded46) to head (76cdb5b).
Report is 89 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #327      +/-   ##
==========================================
+ Coverage   98.20%   98.27%   +0.07%     
==========================================
  Files          64       64              
  Lines        7930     8029      +99     
==========================================
+ Hits         7787     7890     +103     
+ Misses        143      139       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johannaengland johannaengland force-pushed the optimization/reload-pollfile-on-nmtime-changed branch from 06ada60 to 75f26df Compare July 26, 2024 11:07
runborg
runborg previously requested changes Aug 1, 2024
src/zino/scheduler.py Outdated Show resolved Hide resolved
@johannaengland johannaengland force-pushed the optimization/reload-pollfile-on-nmtime-changed branch from 75f26df to fefada5 Compare August 2, 2024 09:53
@johannaengland
Copy link
Contributor Author

I have rebased this instead of adding more commit because I have rethought how to access the saved attribute of when the poll file was last modified.

@johannaengland johannaengland force-pushed the optimization/reload-pollfile-on-nmtime-changed branch 2 times, most recently from 126f35e to dd1f040 Compare August 2, 2024 10:12
This will be used to determine if the pollfile has been modified since the last read
@johannaengland johannaengland force-pushed the optimization/reload-pollfile-on-nmtime-changed branch from dd1f040 to 5e6d96d Compare August 13, 2024 10:22
This should rarely/never happen, since we check for the existence of the pollfile
when loading the config and earlier in the same function, but better safe than sorry
@johannaengland johannaengland force-pushed the optimization/reload-pollfile-on-nmtime-changed branch from 5e6d96d to 5987e68 Compare August 13, 2024 11:13
Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

Nice! Still, let me throw some nit-picks at you :)

src/zino/scheduler.py Show resolved Hide resolved
src/zino/scheduler.py Outdated Show resolved Hide resolved
tests/scheduler_test.py Outdated Show resolved Hide resolved
src/zino/state.py Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Aug 21, 2024

Copy link
Member

@lunkwill42 lunkwill42 left a comment

Choose a reason for hiding this comment

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

Might still consider factoring out the timestamp checking to a separate function, but this will definitely do :)

@lunkwill42 lunkwill42 dismissed runborg’s stale review August 29, 2024 09:15

Runar's suggestion has been fixed.

@lunkwill42 lunkwill42 merged commit 4cbae03 into Uninett:master Aug 29, 2024
10 checks passed
@johannaengland johannaengland deleted the optimization/reload-pollfile-on-nmtime-changed branch August 29, 2024 09:17
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.

Only load and parse polldevs.cf if its mtime value has changed
3 participants