Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy.lock #49

Open
tamagokun opened this issue Jan 30, 2014 · 2 comments
Open

deploy.lock #49

tamagokun opened this issue Jan 30, 2014 · 2 comments

Comments

@tamagokun
Copy link
Owner

While a deploy is running, create a deploy.lock file so that subsequent deploys cannot be happening at the same time.

Things to look out for:

If a deploy fails, will it always be able to remove the deploy.lock file? If it cannot, people will be stuck without being able to deploy.

@tamagokun
Copy link
Owner Author

There would need to be a "force" option to override a locked deploy.

@muxx
Copy link

muxx commented Feb 28, 2014

You can look at flock. Example code

$flock = new FLock(__CLASS__);
if ($flock->isLocked()) {
    $output->writeln("<error> Command ". $this->getName(). " already running in this system. Kill it or try again later </error>", OutputInterface::VERBOSITY_QUIET);                                                                    
    return -1;
}

which uses class Flock from intaro/pinboard#61 (comment). This realization must unlock file when process failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants