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

Logs are being deleted when restarting django-chroniker #329

Open
tehhuimin opened this issue May 29, 2023 · 0 comments
Open

Logs are being deleted when restarting django-chroniker #329

tehhuimin opened this issue May 29, 2023 · 0 comments

Comments

@tehhuimin
Copy link

Issue Description:
Hi, we face this issue on our environment when we restart the django-chroniker service, it will delete whole bunch of previous logs in all jobs, even we have set the Maximum log entries for that specific job to be 1000 at that job has lesser than 1000 logs at that moment.

Expected Behavior:
Expected behavior is that logs are being persisted for each job until reach the Maximum log entries is reached.

Actual Behavior:
Some logs from other jobs are deleted when they haven't exceeded the threshold set.

Steps to Reproduce:

  1. Create a job and set a Maximum log entries=1000 for the job.
  2. Create another job B and set maxim log entries = 1000 for the job.
  3. Run a job at 1 minute interval until we have more than 1000 logs for job A.
  4. Run the job a few times for job B (have log entries less than 1000).
  5. Restart django-chroniker.
  6. Note that some of the logs in job B will also be deleted.

Possible Solution:
I have made a PR at #328.
This will ensure the logs are only deleted for the Jobs that has exceeded threshold.

Environment:
Ubuntu 20.04.6
django-chroniker version: django-chroniker==1.0.22

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

No branches or pull requests

1 participant