[LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Fri Oct 19 12:54:59 EDT 2018


raeburn		Fri Oct 19 16:54:59 2018 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Log (to lonnet.log) if storage of firstaccess times is not needed or fails.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1385 loncom/lonnet/perl/lonnet.pm:1.1386
--- loncom/lonnet/perl/lonnet.pm:1.1385	Fri Sep 21 03:38:44 2018
+++ loncom/lonnet/perl/lonnet.pm	Fri Oct 19 16:54:58 2018
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1385 2018/09/21 03:38:44 raeburn Exp $
+# $Id: lonnet.pm,v 1.1386 2018/10/19 16:54:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -5241,7 +5241,12 @@
     }
     $cachedkey='';
     my $firstaccess=&get_first_access($type,$symb,$map);
-    if (!$firstaccess) {
+    if ($firstaccess) {
+        &logthis("First access time already set ($firstaccess) when attempting ".
+                 "to set new value (type: $type, extent: $res) for $uname:$udom ". 
+                 "in $courseid"); 
+        return 'already_set';
+    } else {
         my $start = time;
 	my $putres = &put('firstaccesstimes',{"$courseid\0$res"=>$start},
                           $udom,$uname);
@@ -5257,6 +5262,9 @@
             if (($cachedtime) && (abs($start-$cachedtime) < 5)) {
                 $cachedtimes{"$courseid\0$res"} = $start;
             }
+        } elsif ($putres ne 'refused') {
+            &logthis("Result: $putres when attempting to set first access time ".
+                     "(type: $type, extent: $res) for $uname:$udom in $courseid");
         }
         return $putres;
     }




More information about the LON-CAPA-cvs mailing list