[Rt-commit] rt branch, 4.4/crontool-reload-ticket, created. rt-4.4.4-90-g4f7a9bf91b
? sunnavy
sunnavy at bestpractical.com
Fri Mar 20 15:57:14 EDT 2020
The branch, 4.4/crontool-reload-ticket has been created
at 4f7a9bf91b481263a6b1337b480e4607c09cdd04 (commit)
- Log -----------------------------------------------------------------
commit 4f7a9bf91b481263a6b1337b480e4607c09cdd04
Author: sunnavy <sunnavy at bestpractical.com>
Date: Sat Mar 21 03:20:50 2020 +0800
Add reload-ticket option to refresh metadata before processing
diff --git a/bin/rt-crontool.in b/bin/rt-crontool.in
index 579a1d3736..6916bd87af 100644
--- a/bin/rt-crontool.in
+++ b/bin/rt-crontool.in
@@ -74,7 +74,7 @@ use Getopt::Long;
use RT::Interface::CLI qw(GetCurrentUser loc);
my ( $search, $condition, $actions, $search_arg, $condition_arg, $actions_arg,
- $template, $template_id, $transaction, $transaction_type, $help, $log, $verbose );
+ $template, $template_id, $transaction, $transaction_type, $reload_ticket, $help, $log, $verbose );
GetOptions(
"search=s" => \$search,
"search-arg=s" => \$search_arg,
@@ -86,6 +86,7 @@ GetOptions(
"template-id=s" => \$template_id,
"transaction=s" => \$transaction,
"transaction-type=s" => \$transaction_type,
+ "reload-ticket" => \$reload_ticket,
"log=s" => \$log,
"verbose|v" => \$verbose,
"help" => \$help,
@@ -154,6 +155,7 @@ $search->Prepare();
#for each ticket we've found
while ( my $ticket = $tickets->Next() ) {
+ $ticket->Load($ticket->Id) if $reload_ticket;
print $ticket->Id() . ":\n" if ($verbose);
my $template_obj = get_template( $ticket );
@@ -453,6 +455,11 @@ Specify if you want to use either 'first', 'last' or 'all' transactions
Specify the comma separated list of transactions' types you want to use
+=item reload-ticket
+
+Reload ticket before processing in tickets iteration. This is to refresh
+ticket metadata, which is useful especially for long-running jobs.
+
=item log
Adjust LogToSTDERR config option
-----------------------------------------------------------------------
More information about the rt-commit
mailing list