[LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf /interface lonsearchcat.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 06 Jan 2003 13:54:25 -0000


www		Mon Jan  6 08:54:25 2003 EDT

  Modified files:              
    /loncom	loncapa_apache.conf 
    /loncom/interface	lonsearchcat.pm 
  Log:
  It will be hard to catch every possibility of the module quitting prematurely
  and not untieing the hash. Attempt to use cleanup handler.
  
  
Index: loncom/loncapa_apache.conf
diff -u loncom/loncapa_apache.conf:1.27 loncom/loncapa_apache.conf:1.28
--- loncom/loncapa_apache.conf:1.27	Thu Dec 26 10:15:33 2002
+++ loncom/loncapa_apache.conf	Mon Jan  6 08:54:25 2003
@@ -1,7 +1,7 @@
 ##
 ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file
 ##
-## $Id: loncapa_apache.conf,v 1.27 2002/12/26 15:15:33 www Exp $
+## $Id: loncapa_apache.conf,v 1.28 2003/01/06 13:54:25 www Exp $
 ##
 ## 1/11/2002 - Scott Harrison
 ## 2/19/2002 - Scott Harrison
@@ -528,6 +528,7 @@
 PerlAccessHandler       Apache::lonacc
 SetHandler perl-script
 PerlHandler Apache::lonsearchcat
+PerlCleanupHandler Apache::lonsearchcat::cleanup
 ErrorDocument     403 /adm/login
 ErrorDocument     413 /adm/overloaded.txt
 ErrorDocument	  500 /adm/errorhandler
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.161 loncom/interface/lonsearchcat.pm:1.162
--- loncom/interface/lonsearchcat.pm:1.161	Fri Nov 22 13:36:07 2002
+++ loncom/interface/lonsearchcat.pm	Mon Jan  6 08:54:25 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.161 2002/11/22 18:36:07 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.162 2003/01/06 13:54:25 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2250,8 +2250,7 @@
     ##
     foreach my $row (@Results) {
         if ($connection->aborted()) {
-            untie %groupsearch_db if (tied(%groupsearch_db));
-            &Apache::lonmysql::disconnect_from_db();
+            &cleanup();
             return;
         }
         my %Fields = %{&parse_row(@$row)};
@@ -2962,6 +2961,11 @@
 }
 
 1;
+
+sub cleanup {
+    untie %groupsearch_db if (tied(%groupsearch_db));
+    &Apache::lonmysql::disconnect_from_db();
+}
 
 __END__