Changeset 28765


Ignore:
Timestamp:
2013-12-18T10:17:20+13:00 (8 years ago)
Author:
jmt12
Message:

Making the waiting for TDBServer exit a little more finegrained - i.e. 1/100th of a second rather than 1 second

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tdb-edit/trunk/src/perllib/dbutil/tdbserver.pm

    r27425 r28765  
    2929package dbutil::tdbserver;
    3030
     31# Pragma
    3132use strict;
    3233use warnings;
    3334
    34 # We're going to have to delve into locking (a little) to prevent multiple
    35 # threads trying to launch the server at once
     35# Modules
     36# - we're going to have to delve into locking (a little) to prevent
     37#   multiple threads trying to launch the server at once
    3638use Fcntl qw(:flock);
    37 
     39# - we'll also need to wait around for an indeterminate amount of time for the
     40#   TDBServer to exit (detected by its lockfile disappearing)
     41use Time::HiRes  qw( usleep );
     42
     43# Greenstone modules
    3844use TDBClient;
    3945use util;
     
    184190        $blurb = '[' . $server_lockfile_path . ']';
    185191      }
    186       print '* Waiting for TDBServer to exit';
     192      print '* Waiting for TDBServer to exit... ';
    187193      if (-e $server_lockfile_path)
    188194      {
    189195        while (-e $server_lockfile_path)
    190196        {
    191           print '.';
    192           sleep(1);
     197          usleep(10000);
    193198        }
    194199      }
Note: See TracChangeset for help on using the changeset viewer.