logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Pinto::Locker - Manage locks to synchronize concurrent operations

Author

       Jeffrey Ryan Thalhammer <jeff@stratopan.com>

Description

Methods

lock
       Attempts to get a lock on a Pinto repository.  If the repository is already locked, we will attempt to
       contact the current lock holder and make sure they are really alive.  If not, then we will steal the
       lock.  If they are, then we patiently wait until we timeout, which is about 60 seconds.

   unlock
       Releases the lock on the Pinto repository so that other processes can get to work.

       In many situations, a Pinto repository is a shared resource.  At any given moment, multiple processes may
       be trying to add distributions, remove packages, or pull files from a mirror.  To keep things working
       properly, we can only let one process fiddle with the repository at a time.  This module manages a lock
       file for that purpose.

       Supposedly, this does work on NFS.  But it cannot steal the lock from a dead process if that process was
       not running on the same host.

Name

       Pinto::Locker - Manage locks to synchronize concurrent operations

Version

       version 0.14

See Also