diff --git a/eprints1.pl b/eprints1.pl index 59be59a14124a5dd7d493bdf7982fc462be80956..4595b9e954de7bd3eb00cc8c78b34bea914ba087 100755 --- a/eprints1.pl +++ b/eprints1.pl @@ -114,8 +114,8 @@ my $op_mode= 'unknown'; # ====================================================================== # BEGIN OT2UT: Othes to Utheses -# my $ot2ut_context= 'ot2ut-entw'; # TODO: parametrize - my $ot2ut_context= 'ot2ut-test'; # TODO: parametrize + my $ot2ut_context= 'ot2ut-entw'; # TODO: parametrize +# my $ot2ut_context= 'ot2ut-test'; # TODO: parametrize # my $ot2ut_context= 'ot2ut-prod'; # TODO: parametrize my $oma_sleep_time= 10; my $MAX_METABLOCK= 670; @@ -589,6 +589,7 @@ elsif ($op_mode eq 'debug_filenames') elsif ($op_mode eq 'update-policies') { update_policies(@PARS); + policies_stats('policies updated'); } elsif ($op_mode eq 'policies-stats') { @@ -2744,6 +2745,10 @@ sub oma send_message("send_ids: $res"); $new_status= 'done' if (@$synced); } + elsif ($row->{action} eq 'reload') + { + exec($0); + } $col_req->update({ _id => $row->{_id}}, { '$set' => { status => $new_status, ts_finish => Util::ts::ts_ISO_gmt() }}); activity({ activity => 'listening'}); @@ -2787,6 +2792,14 @@ sub activity $last_activity= time(); } +=head2 ot2ut (pars) + + ot2ut() ... + ot2ut('block' => $number) ... send objects in othes block $number + ot2ut(@eprint_ids) ... send othes objects with these eprint ids + +=cut + sub ot2ut { my @eprint_ids= @_; @@ -4728,6 +4741,8 @@ sub update_policies print __LINE__, " stats: ", Dumper(\%stats); print __LINE__, " embargo dates: ", Dumper(\%doc_embargo_dates); + + return {}; } sub policies_stats @@ -5082,12 +5097,7 @@ sub policies_stats my $bucket_cnt= $cctab->show_tsv(['othes', @contexts], 'counters.tsv'); my $now= scalar localtime(time()); - my $msg_html; - if ($msg) - { - $msg_html= '<p><font color="red">' . $msg . '</font></p>'; - } - + my $msg_html= 'update'; my %stale_uploads= (); my $idx_html= join('/', $base_path, 'index.html'); open(IDX, '>:utf8', $idx_html); @@ -5102,9 +5112,10 @@ sub policies_stats </style> </head> <body> - +<h1>othes to utheses transfer statistics</h1> <p>last refreshed: $now</p> -$msg_html +<p>Status of transfers from othes to these utheses instances.</p> +<p><font color="red">$msg</font></p> <p><a href="buckets.html" target="buckets">$bucket_cnt buckets</a></p> <h2>upload counters</h2> <table border="1"> @@ -5115,6 +5126,13 @@ $msg_html <th colspan="3" width="200px">test</th> <th colspan="3" width="200px">prod</th> </tr> +<tr> + <th>number</th> + <th>total</th> + <th>count</th><th>pct</th><th>err</th> + <th>count</th><th>pct</th><th>err</th> + <th>count</th><th>pct</th><th>err</th> +</tr> EOX for (my $metablock_nr= 0; $metablock_nr <= $#metablocks; $metablock_nr++) @@ -5124,7 +5142,7 @@ EOX my $mb_html= sprintf("metablock_%d.html", $metablock_nr); my $mb_html_fp= join('/', $base_path, $mb_html); - print IDX "<tr>\n <td><a href=\"$mb_html\" target=\"metablocks\">", $metablock_nr, "</a></td>\n <td>", $mb_othes, "</td>\n"; + print IDX "<tr>\n <td><a href=\"$mb_html\" target=\"metablocks\">", $metablock_nr, " (${metablock_nr}xxyy)</a></td>\n <td>", $mb_othes, "</td>\n"; foreach my $context (qw(entw test prod)) { @@ -5159,6 +5177,13 @@ EOX <th colspan="3" width="200px">test</th> <th colspan="3" width="200px">prod</th> </tr> +<tr> + <th>number</th> + <th>total</th> + <th>count</th><th>pct</th><th>err</th> + <th>count</th><th>pct</th><th>err</th> + <th>count</th><th>pct</th><th>err</th> +</tr> EOX my $block_start= $metablock_nr*100; @@ -5173,7 +5198,7 @@ EOX my $b_html_fp= join('/', $base_path, $b_html); my $b_othes= $block->{othes}->{cnt_total}; - print MB "<tr>\n <td><a href=\"$b_html\" target=\"blocks\">", $block_nr, "</a></td>\n <td>", $b_othes, "</td>\n"; + print MB "<tr>\n <td><a href=\"$b_html\" target=\"blocks\">", $block_nr, " (${block_nr}yy)</a></td>\n <td>", $b_othes, "</td>\n"; foreach my $context (qw(entw test prod)) { @@ -5201,11 +5226,17 @@ EOX <p>last refreshed: $now</p> <table border="1"> <tr> - <th x_width="100px" colspan="2" width="25%">eprint_id</th> + <th x_width="100px" colspan="2" width="25%">othes</th> <th x_width="100px" colspan="2" width="25%">entw</th> <th x_width="100px" colspan="2" width="25%">test</th> <th x_width="100px" colspan="2" width="25%">prod</th> </tr> +<tr> + <th>eprint_id</th><th>last_mod</th> + <th>uth_id</th><th>upload</th> + <th>uth_id</th><th>upload</th> + <th>uth_id</th><th>upload</th> +</tr> EOX my $items= $block->{items}; @@ -5298,7 +5329,11 @@ EOX my @stale_contexts= sort keys %stale_uploads; if (@stale_contexts) { - print IDX "<h2>stale uploads</h2>\n"; + print IDX <<EOX; +<h2>stale uploads</h2> +<p>Objects, which were updated on othes after the upload to the target instance.</p> +EOX + my $last_block; foreach my $ctx (@stale_contexts) { @@ -5721,7 +5756,7 @@ EOX { my $val= shift (@vals); my $desc= $bucketlist_column_descriptions{$col} || ' '; - print LST "<tr><th>$col</th><td>$val</td><td>$desc</td></tr>\n"; + print LST "<tr><th>$col</th><td>$val</td><td style=\"text-align:left\">$desc</td></tr>\n"; } print LST "</table>\n";