Changeset 27425

Show
Ignore:
Timestamp:
24.05.2013 09:40:52 (6 years ago)
Author:
jmt12
Message:

Tidying up debug comments and processing comments

Files:
1 modified

Legend:

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

    r27399 r27425  
    6969  my $we_started_server = 0; 
    7070  my $server_lockfile_path =  &util::filename_cat($ENV{'GSDLHOME'},'collect',$collection,'tmp','tdbserver.lock'); 
    71   print " * Searching for TDBServer lockfile...\n"; 
     71  print " * Searching for TDBServer lockfile...\n" if ($debug); 
    7272  if (!-e $server_lockfile_path) 
    7373  { 
    74     print "Not found.\n"; 
     74    print "Not found.\n" if ($debug); 
    7575    # We need to lock here to ensure only one thread enters the following code, 
    7676    # sees a missing TDBServer, and launches it 
     
    8585      # ...start it! 
    8686      my $launch_cmd = 'TDBServer.pl "' . $$ . '" "' . $collection . '"'; 
    87       print "* Starting TDBServer for: " . $collection . " [" . $launch_cmd . "]... "; 
     87      print "* Starting TDBServer for: " . $collection . " [" . $launch_cmd . "]...\n"; 
    8888      # @note I once had the below pipe ending with 2>&1 |, but that then blocks 
    8989      #       indefinitely when looping and reading <SERVERIN>. 
     
    125125        die("Error! TDBServer failed to create lock file. Check server logs."); 
    126126      } 
    127       else 
    128       { 
    129         print "Running on " . $server_host . ":" . $server_port . "\n"; 
     127      elsif ($debug) 
     128      { 
     129        print "* Server now running on " . $server_host . ":" . $server_port . "\n"; 
    130130      } 
    131131      # record this for later 
     
    138138  else 
    139139  { 
    140     print "Found!\n"; 
     140    print "Found!\n" if ($debug); 
    141141  } 
    142142  # record this for later 
     
    179179      # While the file exists, we should wait 
    180180      autoflush STDOUT 1; 
    181       print "* Waiting for TDBServer to exit [" . $server_lockfile_path . "]"; 
     181      my $blurb = ''; 
     182      if ($debug) 
     183      { 
     184        $blurb = '[' . $server_lockfile_path . ']'; 
     185      } 
     186      print '* Waiting for TDBServer to exit'; 
    182187      if (-e $server_lockfile_path) 
    183188      { 
    184189        while (-e $server_lockfile_path) 
    185190        { 
    186           print "."; 
     191          print '.'; 
    187192          sleep(1); 
    188193        } 
     
    191196    else 
    192197    { 
    193       print "* NOT Waiting for TDBServer to exit... "; 
     198      print '* NOT Waiting for TDBServer to exit... '; 
    194199    } 
    195200    print " Done!\n";