Development

Changeset 9893

You must first sign up to be able to contribute.

Changeset 9893

Show
Ignore:
Timestamp:
06/26/08 14:12:48 (2 months ago)
Author:
fabien
Message:

fixed locking issues with the clear-cache, log-rotate, enable, and disable tasks (closes #3827)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/data/tasks/sfPakeMisc.php

    r8288 r9893  
    200200 
    201201  // create a lock file 
    202   pake_touch($sf_root_dir.'/'.$lock_name.'.lck', ''); 
     202  $lock_file = $sf_root_dir.'/'.$lock_name.'-cli.lck'; 
     203  pake_touch($lock_file, ''); 
    203204 
    204205  // change mode so the web user can remove it if we die 
    205   pake_chmod($lock_name.'.lck', $sf_root_dir, 0777); 
     206  pake_chmod($lock_file, '', 0777); 
    206207 
    207208  // remove cache files 
     
    209210 
    210211  // release lock 
    211   pake_remove($sf_root_dir.'/'.$lock_name.'.lck', ''); 
     212  pake_remove($lock_file, ''); 
    212213} 
    213214 
     
    296297  $env = $args[1]; 
    297298 
    298   $lockFile = $app.'_'.$env.'.clilock'; 
     299  $lockFile = $app.'_'.$env.'.lck'; 
    299300  $locks = pakeFinder::type('file')->ignore_version_control()->prune('.svn')->discard('.svn')->maxdepth(0)->name($lockFile)->relative()->in('./'); 
    300301 
     
    322323  $env = $args[1]; 
    323324 
    324   $lockFile = $app.'_'.$env.'.clilock'; 
     325  $lockFile = $app.'_'.$env.'.lck'; 
    325326 
    326327  if (!file_exists(sfConfig::get('sf_root_dir').'/'.$lockFile)) 
    327328  { 
    328     pake_touch(sfConfig::get('sf_root_dir').'/'.$lockFile, '777'); 
     329    pake_touch(sfConfig::get('sf_root_dir').'/'.$lockFile, ''); 
    329330 
    330331    pake_echo_action('enable', "$app [$env] has been DISABLED"); 
  • branches/1.0/lib/log/sfLogManager.class.php

    r3329 r9893  
    7777    { 
    7878      // create a lock file 
    79       $lock_name = $app.'_'.$env.'.lck'; 
    80       touch(sfConfig::get('sf_root_dir').'/'.$lock_name); 
     79      $lockFile = sfConfig::get('sf_root_dir').'/'.$app.'_'.$env.'-cli.lck'; 
     80      touch($lockFile); 
     81      chmod($lockFile, 0777); 
    8182 
    8283      // if log file exists rotate it 
     
    109110        } 
    110111      } 
     112 
     113      unlink($lockFile); 
    111114    } 
    112115  } 
  • branches/1.0/lib/util/sfCore.class.php

    r9263 r9893  
    9595  static public function checkLock() 
    9696  { 
    97     if (sfToolkit::hasLockFile(SF_ROOT_DIR.DIRECTORY_SEPARATOR.SF_APP.'_'.SF_ENVIRONMENT.'.lck', 5)) 
     97    if ( 
     98      sfToolkit::hasLockFile(SF_ROOT_DIR.DIRECTORY_SEPARATOR.SF_APP.'_'.SF_ENVIRONMENT.'-cli.lck', 5) 
     99      || 
     100      sfToolkit::hasLockFile(SF_ROOT_DIR.DIRECTORY_SEPARATOR.SF_APP.'_'.SF_ENVIRONMENT.'.lck') 
     101    ) 
    98102    { 
    99103      // application is not available