Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.1288 and 1.1289

version 1.1288, 2015/06/12 21:11:20 version 1.1289, 2015/06/16 20:24:59
Line 92  use GDBM_File; Line 92  use GDBM_File;
 use HTML::LCParser;  use HTML::LCParser;
 use Fcntl qw(:flock);  use Fcntl qw(:flock);
 use Storable qw(thaw nfreeze);  use Storable qw(thaw nfreeze);
 use Time::HiRes qw( gettimeofday tv_interval );  use Time::HiRes qw( sleep gettimeofday tv_interval );
 use Cache::Memcached;  use Cache::Memcached;
 use Digest::MD5;  use Digest::MD5;
 use Math::Random;  use Math::Random;
Line 101  use LONCAPA qw(:DEFAULT :match); Line 101  use LONCAPA qw(:DEFAULT :match);
 use LONCAPA::Configuration;  use LONCAPA::Configuration;
 use LONCAPA::lonmetadata;  use LONCAPA::lonmetadata;
 use LONCAPA::Lond;  use LONCAPA::Lond;
 use Time::HiRes qw(sleep);  
   
 use File::Copy;  use File::Copy;
   
Line 376  sub subreply { Line 375  sub subreply {
   
     my $lockfile=$peerfile.".lock";      my $lockfile=$peerfile.".lock";
     while (-e $lockfile) { # Need to wait for the lockfile to disappear.      while (-e $lockfile) { # Need to wait for the lockfile to disappear.
  Time::HiRes::sleep(0.1);   sleep(0.1);
     }      }
     # At this point, either a loncnew parent is listening or an old lonc      # At this point, either a loncnew parent is listening or an old lonc
     # or loncnew child is listening so we can connect or everything's dead.      # or loncnew child is listening so we can connect or everything's dead.
Line 394  sub subreply { Line 393  sub subreply {
  } else {   } else {
     &create_connection(&hostname($server),$server);      &create_connection(&hostname($server),$server);
  }   }
         Time::HiRes::sleep(0.1); # Try again later if failed connection.          sleep(0.1); # Try again later if failed connection.
     }      }
     my $answer;      my $answer;
     if ($client) {      if ($client) {
Line 7679  sub get_query_reply { Line 7678  sub get_query_reply {
     my $replyfile=LONCAPA::tempdir().$queryid;      my $replyfile=LONCAPA::tempdir().$queryid;
     my $reply='';      my $reply='';
     for (1..100) {      for (1..100) {
  Time::HiRes::sleep(0.2);   sleep(0.2);
         if (-e $replyfile.'.end') {          if (-e $replyfile.'.end') {
     if (open(my $fh,$replyfile)) {      if (open(my $fh,$replyfile)) {
  $reply = join('',<$fh>);   $reply = join('',<$fh>);
Line 9524  sub modify_access_controls { Line 9523  sub modify_access_controls {
         
     while (($gotlock ne 'ok') && $tries < 10) {      while (($gotlock ne 'ok') && $tries < 10) {
         $tries ++;          $tries ++;
         Time::HiRes::sleep(0.1);          sleep(0.1);
         $gotlock = &newput('file_permissions',$lockhash,$domain,$user);          $gotlock = &newput('file_permissions',$lockhash,$domain,$user);
     }      }
     if ($gotlock eq 'ok') {      if ($gotlock eq 'ok') {

Removed from v.1.1288  
changed lines
  Added in v.1.1289


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>