[LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm

www lon-capa-cvs@mail.lon-capa.org
Wed, 12 Jan 2005 20:58:26 -0000


www		Wed Jan 12 15:58:26 2005 EDT

  Modified files:              
    /loncom/publisher	lonpublisher.pm 
  Log:
  Aargh ... we clean out the environment when rendering in Phase 1, so extra 
  environment variables are forgotten between runs during batch.
  
  The beauty of persistent memory: stuff URLs into a global var instead.
  
  
Index: loncom/publisher/lonpublisher.pm
diff -u loncom/publisher/lonpublisher.pm:1.182 loncom/publisher/lonpublisher.pm:1.183
--- loncom/publisher/lonpublisher.pm:1.182	Wed Jan 12 11:18:54 2005
+++ loncom/publisher/lonpublisher.pm	Wed Jan 12 15:58:26 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Publication Handler
 #
-# $Id: lonpublisher.pm,v 1.182 2005/01/12 16:18:54 www Exp $
+# $Id: lonpublisher.pm,v 1.183 2005/01/12 20:58:26 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -139,6 +139,7 @@
 my $cudom;
 
 my $registered_cleanup;
+my $modified_urls;
 
 =pod
 
@@ -1545,10 +1546,8 @@
     $r->rflush;
 
 # ------------------------------------------------------------- Trigger updates
-    print $logfile("\nRegistering for notifications: $target $source\n");
-    push(@{$ENV{'internal.publication.targetsource'}},[$target,$source]);
+    push(@{$modified_urls},[$target,$source]);
     unless ($registered_cleanup) {
-	&Apache::lonnet::logthis('Cleanup handler registered');
 	$r->register_cleanup(\&notify);
 	$registered_cleanup=1;
     }
@@ -1580,8 +1579,7 @@
 # =============================================================== Notifications
 sub notify {  
 # --------------------------------------------------- Send update notifications
-    &Apache::lonnet::logthis('Cleanup Phase Publication Handler');
-    foreach my $targetsource (@{$ENV{'internal.publication.targetsource'}}){
+    foreach my $targetsource (@{$modified_urls}){
 	my ($target,$source)=@{$targetsource};
 	my $logfile=Apache::File->new('>>'.$source.'.log');
 	print $logfile "\nCleanup phase: Notifications\n";
@@ -1824,8 +1822,9 @@
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['filename']);
 
-# ------------------------------------------------- Flag for registered cleanup
+# -------------------------------------- Flag and buffer for registered cleanup
     $registered_cleanup=0;
+    @{$modified_urls}=();
 # -------------------------------------------------------------- Check filename
 
     my $fn=&Apache::lonnet::unescape($ENV{'form.filename'});