From afbc42dba3385cf399d5acbdde002b1eb174b0bc Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Mon, 25 Aug 2008 21:32:26 +0000 Subject: [PATCH] fixed: PurgeOldInboxMessages just didnt work --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Workflow/Activity/PurgeOldInboxMessages.pm | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 444295f25..db07dd86d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -8,6 +8,7 @@ - fixed: DataForm doesn't work properly with internationalized fields - fixed: incoming data not properly decoded from utf8 - fixed: Can't call method "getSku" on unblessed reference + - fixed: PurgeOldInboxMessages just didn't work 7.5.22 - fixed: Layout template now gets prepared correctly diff --git a/lib/WebGUI/Workflow/Activity/PurgeOldInboxMessages.pm b/lib/WebGUI/Workflow/Activity/PurgeOldInboxMessages.pm index 55af93fda..b57dd54f2 100644 --- a/lib/WebGUI/Workflow/Activity/PurgeOldInboxMessages.pm +++ b/lib/WebGUI/Workflow/Activity/PurgeOldInboxMessages.pm @@ -84,13 +84,9 @@ sub execute { # keep track of how much time it's taking my $start = time; - # Only purge this many per operation to prevent MySQL returning - # a half-million rows (which will take longer than the time we have) - my $limit = 2_500; - my $sth = $session->db->read( - "SELECT messageId FROM inbox WHERE completedOn IS NOT NULL AND dateStamp < ? ASC LIMIT $limit", + "SELECT messageId FROM inbox WHERE completedOn IS NOT NULL AND dateStamp < ?", [ $start - $self->get('purgeAfter') ], );