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
[X] I agree to follow this project's Code of Conduct
Is there an existing issue for this?
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?
Would you be interested in sponsoring this enhancement?
Code of Conduct