-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Make DB interval adjustable #172
Conversation
…asily adjustable via the config file. Signed-off-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: DL6ER <dl6er@dl6er.de> Conflicts: README.md config.c
Wouldn't writing to the database in intervals longer than a day miss some queries? |
Signed-off-by: DL6ER <dl6er@dl6er.de>
config.c
Outdated
// How often do we store queries in FTL's database [minutes]? | ||
// this value can be a floating point number, e.g. "DBINTERVAL=0.5" | ||
// defaults to: 1 (once per minute) | ||
config.DBinterval = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default should be 60 (once every 60 seconds) based on how it is used below.
Signed-off-by: DL6ER <dl6er@dl6er.de>
… is done (but before). This ensures that the queries will be written to the database even if the user specifies DBINTERVAL=n*60 (where n=1,2,3,...) which is a special that was not explicitly considered so far. Signed-off-by: DL6ER <dl6er@dl6er.de>
e72fbcb
to
5951e5b
Compare
@DL6ER - I'm thinking that you probably also want to force a write-out before This could be handled by the init system (systemd for example) if there is a command one can pass to |
No, I don't really want that. It is unforeseeable how long the write will take and I consider it as bad practice to react only delayed to requests to terminate. I think a sane write out interval (i.e. several times an hour) should be sufficient to achieve that everything is properly saved. There is only one scenario where you could loose some queries and that is having a very long interval, shutting down your Pi-hole and then powering it back on at least 48 hours later. I'm not sure if that is a very likely scenario as you wouldn't have DNS functionality in your network as long as Pi-hole is shut down. |
@DL6ER - Sounds good, just wanted to check. |
@DL6ER - The Arch package for pi-hole-ftl has this PR#172 and PR#167 applied to the standard v2.12. I have Local time is 5:25 PM:
|
Strange... I will set the timer to 121.0 for me as well and report tomorrow what happened over night. edit: So far, so good:
|
I got the same...
Yet still no writes (local time is 18:49)...
|
@graysky2 It seems to work fine for me, writes are done every 02:01 (HH:MM):
and
|
Are you using 2.12 plus those 2 patches or the dev branch?
|
It continued as expected for me so far (08:55, 10:56, 12:57, 14:58). I'm on the branch of this PR. I quickly reviewed what that means:
However, nothing outside of this PR should be changing anything here. How about other values? I think you said already that |
Very odd... a value of 2 works just fine. I am testing 61 now and will report back. |
Nope... a value of 61 has failed to write.
Local time is 16:55:
|
@DL6ER - Looks like that is omitted... see here: https://aur.archlinux.org/cgit/aur.git/commit/?h=pi-hole-ftl&id=6efb21f2818cc18b68e86cbf03e79fe742c6f510 |
The X and checkmarks in the git log are confusing to me... ??? |
Are you trying to make the current branch a package? Why do you need to distinguish between commits? |
@Mcat12 - No, the intent is to incorporate the adjustable db into 2.12. The patch I referenced above is working with a |
Okay, so there is no issue with this PR or our code base but only in the way you applied which modifications to the last tagged release. Good to know, thanks for doing extensive testing BTW. |
@DL6ER - You're welcome and thank you for the quick implementation of this request. Is the patch I referenced above the correct set of commits to apply to 2.12 for the Arch package? |
Not sure what/which link you are referring to... If you are asking what the |
Thanks again. Will wait for 2.12.1 or whatever you bump to. |
By submitting this pull request, I confirm the following (please check boxes, eg [X]) Failure to fill the template will close your PR:
Please submit all pull requests against the
development
branch. Failure to do so will delay or deny your requestHow familiar are you with the codebase?:
10
Make interval in which FTL stores queries in the long term database easily adjustable via the config file.
It defaults to
1.0
(once per minute).It cannot be lower than
0.1
(every six seconds).It cannot be larger than
1440.0
(once a day).Related to pi-hole/pi-hole#1839
This template was created based on the work of
udemy-dl
.