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

raeburn raeburn at source.lon-capa.org
Wed Sep 21 01:15:41 EDT 2016


raeburn		Wed Sep 21 05:15:41 2016 EDT

  Modified files:              
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - Store domain roles information on primary library server to limit number 
    of calls needed to remote servers when a domain has more than one library 
    server.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1323 loncom/lonnet/perl/lonnet.pm:1.1324
--- loncom/lonnet/perl/lonnet.pm:1.1323	Wed Sep 21 04:57:52 2016
+++ loncom/lonnet/perl/lonnet.pm	Wed Sep 21 05:15:40 2016
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1323 2016/09/21 04:57:52 raeburn Exp $
+# $Id: lonnet.pm,v 1.1324 2016/09/21 05:15:40 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4123,10 +4123,19 @@
         delete $domainrolehash{$entry};
     }
     foreach my $dom (keys(%domrolebuffer)) {
-	my %servers = &get_servers($dom,'library');
+	my %servers;
+	if (defined(&domain($dom,'primary'))) {
+	    my $primary=&domain($dom,'primary');
+	    my $hostname=&hostname($primary);
+	    $servers{$primary} = $hostname;
+	} else { 
+	    %servers = &get_servers($dom,'library');
+	}
 	foreach my $tryserver (keys(%servers)) {
-	    unless (&reply('domroleput:'.$dom.':'.
-			   $domrolebuffer{$dom},$tryserver) eq 'ok') {
+	    if (&reply('domroleput:'.$dom.':'.
+		       $domrolebuffer{$dom},$tryserver) eq 'ok') {
+		last;
+	    } else {  
 		&logthis('Put of domain roles failed for '.$dom.' and  '.$tryserver);
 	    }
         }




More information about the LON-CAPA-cvs mailing list