Bugzilla – Attachment 113773 Details for
Bug 27048
Add timestamps to verbose output of rebuild_zebra.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27048: Add basic timekeeping to rebuild_zebra
Bug-27048-Add-basic-timekeeping-to-rebuildzebra.patch (text/plain), 2.14 KB, created by
Martin Renvoize (ashimema)
on 2020-11-18 10:37:26 UTC
(
hide
)
Description:
Bug 27048: Add basic timekeeping to rebuild_zebra
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-11-18 10:37:26 UTC
Size:
2.14 KB
patch
obsolete
>From 31eb61bdd6661602fa51024fc115201ca16bdb63 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 Nov 2020 10:36:43 +0000 >Subject: [PATCH] Bug 27048: Add basic timekeeping to rebuild_zebra > >--- > misc/migration_tools/rebuild_zebra.pl | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > >diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl >index cb42164e06..fb66b0d932 100755 >--- a/misc/migration_tools/rebuild_zebra.pl >+++ b/misc/migration_tools/rebuild_zebra.pl >@@ -209,7 +209,9 @@ if( !defined $LockFH ) { > # the lockfile) > }; > >+my $start_time = time(); > if ( $verbose_logging ) { >+ my $pretty_time = POSIX::strftime("%H:%M:%S",$start_time); > print "Zebra configuration information\n"; > print "================================\n"; > print "Zebra biblio directory = $biblioserverdir\n"; >@@ -219,6 +221,7 @@ if ( $verbose_logging ) { > print "BIBLIONUMBER in : $biblionumbertagfield\$$biblionumbertagsubfield\n"; > print "BIBLIOITEMNUMBER in : $biblioitemnumbertagfield\$$biblioitemnumbertagsubfield\n"; > print "================================\n"; >+ print "Job started: $pretty_time\n"; > } > > my $tester = XML::LibXML->new(); >@@ -267,6 +270,7 @@ if ($daemon_mode) { > > > if ( $verbose_logging ) { >+ print "Indexing complete: ". pretty_time() . "\n"; > print "====================\n"; > print "CLEANING\n"; > print "====================\n"; >@@ -826,6 +830,26 @@ sub _create_lockfile { #returns undef on failure > return ( $fh, $dir.'/'.LOCK_FILENAME ); > } > >+sub pretty_time { >+ use integer; >+ my $now = time; >+ my $elapsed = $now - $start_time; >+ local $_ = $elapsed; >+ my ( $d, $h, $m, $s ); >+ $s = $_ % 60; >+ $_ /= 60; >+ $m = $_ % 60; >+ $_ /= 60; >+ $h = $_ % 24; >+ $_ /= 24; >+ $d = $_; >+ >+ my $now_pretty = POSIX::strftime("%H:%M:%S",$now); >+ my $elapsed_pretty = $d ? "[$d:$h:$m:$s]" : $h ? "[$h:$m:$s]" : $m ? "[$m:$s]" : "[$s]"; >+ >+ return "$now_pretty $elapsed_pretty"; >+} >+ > sub print_usage { > print <<_USAGE_; > $0: reindex MARC bibs and/or authorities in Zebra. >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27048
:
113773
|
113780
|
115931
|
117201
|
117418
|
117452
|
117617