[prev in list] [next in list] [prev in thread] [next in thread]
List: lon-capa-cvs
Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm
From: raeburn via LON-CAPA-cvs <lon-capa-cvs () mail ! lon-capa ! org>
Date: 2021-05-10 18:13:50
Message-ID: cvsraeburn1620670430 () cvsserver
[Download RAW message or body]
raeburn Mon May 10 18:13:50 2021 EDT
Modified files:
/loncom/lonnet/perl lonnet.pm
Log:
- Speed-up &allowed() by ignoring expired or future student or ta roles
(unless current role) when checking for course.*.lock.sections in %env.
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1452 loncom/lonnet/perl/lonnet.pm:1.1453
--- loncom/lonnet/perl/lonnet.pm:1.1452 Mon May 10 16:08:40 2021
+++ loncom/lonnet/perl/lonnet.pm Mon May 10 18:13:50 2021
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1452 2021/05/10 16:08:40 raeburn Exp $
+# $Id: lonnet.pm,v 1.1453 2021/05/10 18:13:50 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -8533,13 +8533,17 @@
# Locks might take effect only after 10 minutes cache expiration for other
# courses, and 2 minutes for current course
- my $envkey;
if ($thisallowed=~/L/) {
- foreach $envkey (keys(%env)) {
+ my $now = time;
+ foreach my $envkey (keys(%env)) {
if ($envkey=~/^user\.role\.(st|ta)\.([^\.]*)/) {
my $courseid=$2;
my $roleid=$1.'.'.$2;
$courseid=~s/^\///;
+ unless ($env{'request.role'} eq $roleid) {
+ my ($start,$end) = split(/\./,$env{$envkey});
+ next unless (($now >= $start) && (!$end || $end > $now));
+ }
my $expiretime=600;
if ($env{'request.role'} eq $roleid) {
$expiretime=120;
_______________________________________________
LON-CAPA-cvs mailing list
LON-CAPA-cvs@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic