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

[Enhancement]: PurgeScheduleHistory - simple improvement #6172

Open
2 of 4 tasks
trouble2 opened this issue Oct 24, 2024 · 0 comments
Open
2 of 4 tasks

[Enhancement]: PurgeScheduleHistory - simple improvement #6172

trouble2 opened this issue Oct 24, 2024 · 0 comments

Comments

@trouble2
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description of problem

I saw in some DNN instances, my schedulehistory table was rather large.
Even if I run the cleanup task (in the scheduler)

So I noticed it only deletes the history items of active tasks.
So for a given task in the schedule let's say there are 1000 history items in the table, and I set it to only keep the last 25 items.
However the task is not enabled, it will keep the 1000 history items in the schedulehistory table.

Description of solution

There is a SP called PurgeScheduleHistory and somewhere it says:

INNER JOIN dbo.[ScheduleHistory] sh ON s.ScheduleID = sh.ScheduleID
WHERE s.Enabled = 1 AND s.RetainHistoryNum <> -1

So if you would remove the s.Enabled =1 part, it will actually clean what is has to clean :-)
Even though the task is disabled, I still think when the setting is keep the last XX records, it should still only keep the last XX records... This keeps the table nice and clean.

Description of alternatives considered

None

Anything else?

No

Do you be plan to contribute code for this enhancement?

  • Yes

Would you be interested in sponsoring this enhancement?

  • Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant