-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
last_changed and last_checked value is not always same despite the website being changed in the latest run #2877
Comments
Meanwhile, I would appreciate if you could guide me on how can i check if the latest watch has detected any changes via api. The less api call i need to make the better. |
please do not confuse/make a mess of the issue, please try to stick to just one thing at a time or it makes a mess for everyone |
The system sets the it is a bit confusing i agree.. so hmm the |
@dgtlmoon I assume you are occupied with other tasks. Do you mind if i submit a PR for this ? |
sure you can try, the PR must include a test (or modify the existing API test) , thanks |
The bug is also here changedetection.io/changedetectionio/update_worker.py Lines 556 to 557 in 202e47d
So what happened was that you received a zero content reply for some reason, in the API when you look at so what happened is that |
I am not exactly sure what you mean. Do you mean the bug is caused due to some other reason or there are other reasons that cause bug alongside what i mentioned. I am aware last_changed is fetched from last written date in history.txt. The issue i mentioned is this last written date being different compared to last_checked date even if the change was detected in last run. I am not sure what "zero content" responses are. |
@sanjeevbhusal could you try the latest |
Describe the bug
last_changed
andlast_checked
value is not same in api response even though the contents have been changed./api/v1/watch
endpoint returns the list of watches. Each watch contains few properties.last_changed
andlast_checked
are among those properties.In some cases, the value for
last_changed
andlast_checked
differ by few seconds even if the change was detected. This doesnot happen for every watch though. For example, take a look at the below json blob where last_changed is 2 seconds less than last_checked.This happens because sometimes, it might take few seconds to actually process a watch that has changed. To be specific, saving screenshot, saving history text etc might take few seconds to actually complete. The value of
last_changed
is recorded before doing any such calculation.However, thelast_checked
timestamp is calculated when the function finishes running.I have verified it by looking the source code
Version
Exact version in the top right area: 0...
Any
How did you install?
Used as a SAAS
To Reproduce
Register a Website that is a bigger in size. This is so that we can increase the processing time which is responsible for this bug.
Expected behavior
If
last_checked
value is x and website has changed,last_changed
should also be x.Screenshots
If applicable, add screenshots to help explain your problem.
The timestamp calculated in line 517 should be used as 'last_checked' in line 574
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: