Lines 229-246
if ($pDebarments && $allDebarments) {
Link Here
|
229 |
usage(1); |
229 |
usage(1); |
230 |
} |
230 |
} |
231 |
|
231 |
|
232 |
<<<<<<< HEAD |
|
|
233 |
say "Confirm flag not passed, running in dry-run mode..." unless $confirm; |
232 |
say "Confirm flag not passed, running in dry-run mode..." unless $confirm; |
234 |
|
233 |
|
235 |
cronlogaction() unless $confirm; |
234 |
cronlogaction() unless $confirm; |
236 |
======= |
|
|
237 |
if (!$mail && $letter_codes) { |
235 |
if (!$mail && $letter_codes) { |
238 |
print "You should not specify --keep-lc if you're not cleaning emails.\n\n"; |
236 |
print "You should not specify --keep-lc if you're not cleaning emails.\n\n"; |
239 |
usage(1); |
237 |
usage(1); |
240 |
} |
238 |
} |
241 |
|
239 |
|
242 |
cronlogaction(); |
240 |
cronlogaction(); |
243 |
>>>>>>> Bug 21214: cleanup_database.pl --keep-lc to dodge deletion in message_queue based on letter_code |
|
|
244 |
|
241 |
|
245 |
my $dbh = C4::Context->dbh(); |
242 |
my $dbh = C4::Context->dbh(); |
246 |
my $sth; |
243 |
my $sth; |
Lines 297-318
if ($zebraqueue_days) {
Link Here
|
297 |
if ($mail) { |
294 |
if ($mail) { |
298 |
my $count = 0; |
295 |
my $count = 0; |
299 |
print "Mail queue purge triggered for $mail days.\n" if $verbose; |
296 |
print "Mail queue purge triggered for $mail days.\n" if $verbose; |
300 |
<<<<<<< HEAD |
|
|
301 |
$sth = $dbh->prepare( |
302 |
q{ |
303 |
DELETE FROM message_queue |
304 |
WHERE time_queued < date_sub(curdate(), INTERVAL ? DAY) |
305 |
} |
306 |
); |
307 |
if ( $confirm ) { |
308 |
$sth->execute($mail) or die $dbh->errstr; |
309 |
$count = $sth->rows; |
310 |
} |
311 |
if ( $verbose ) { |
312 |
say $confirm ? "$count messages were deleted from the mail queue." : "Message from message_queue would have been deleted"; |
313 |
say "Done with message_queue purge."; |
314 |
} |
315 |
======= |
316 |
print "Not deleting emails of type $letter_codes.\n" if ($verbose && $letter_codes); |
297 |
print "Not deleting emails of type $letter_codes.\n" if ($verbose && $letter_codes); |
317 |
my $query = q{ |
298 |
my $query = q{ |
318 |
DELETE FROM message_queue |
299 |
DELETE FROM message_queue |
Lines 329-335
if ($mail) {
Link Here
|
329 |
$count = $sth->rows; |
310 |
$count = $sth->rows; |
330 |
$sth->finish; |
311 |
$sth->finish; |
331 |
print "$count messages were deleted from the mail queue.\nDone with message_queue purge.\n" if $verbose; |
312 |
print "$count messages were deleted from the mail queue.\nDone with message_queue purge.\n" if $verbose; |
332 |
>>>>>>> Bug 21214: cleanup_database.pl --keep-lc to dodge deletion in message_queue based on letter_code |
|
|
333 |
} |
313 |
} |
334 |
|
314 |
|
335 |
if ($purge_merged) { |
315 |
if ($purge_merged) { |
336 |
- |
|
|