[open-ils-commits] r16992 - trunk/Open-ILS/src/support-scripts (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 20 17:16:06 EDT 2010
Author: erickson
Date: 2010-07-20 17:16:00 -0400 (Tue, 20 Jul 2010)
New Revision: 16992
Modified:
trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
Log:
login just before starting work and log out after each request is handled. this is removes the need to check for bad authtokens and re-login mid-process
Modified: trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl
===================================================================
--- trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl 2010-07-20 21:16:00 UTC (rev 16991)
+++ trunk/Open-ILS/src/support-scripts/marc_stream_importer.pl 2010-07-20 21:16:00 UTC (rev 16992)
@@ -373,6 +373,8 @@
my ($imported, $failed) = (0, 0);
+ new_auth_token(); # login
+
if ($real_opts->{noqueue}) {
($imported, $failed) = old_process_batch_data($data);
} else {
@@ -391,6 +393,8 @@
$msg .= "Failed to import $failed records\n" if $failed;
$msg .= "\x00";
print $client $msg;
+
+ clear_auth_token(); # logout
}
@@ -402,10 +406,17 @@
return $authtoken;
}
+sub clear_auth_token {
+ $apputils->simplereq(
+ 'open-ils.auth',
+ 'open-ils.auth.session.delete',
+ $authtoken
+ );
+}
+
##### MAIN ######
osrf_connect($osrf_config);
-new_auth_token();
print "Calling Net::Server run ", (@ARGV ? "with command-line options: " . join(' ', @ARGV) : ''), "\n";
__PACKAGE__->run(conf_file => $conf_file);
More information about the open-ils-commits
mailing list