astronomer/airflow/version_check/models.py
def acquire_lock(cls, check_interval, session):  # type: (datetime.timedelta, sqlalchemy.Session) -> Optional[AstronomerVersionCheck]
        """
        Acquire an exclusive lock to perform an update check if the check is due
        and if another check is not already in progress.

        We use the database to hold the lock for as long as this transaction is open using `FOR UPDATE SKIP LOCKED`.

        This method will either return a row meaning the check is due and we
        have acquired the lock. The lock will be held for the duration of the
        database transaction -- be careful to to close this before you are
        done!

        This will throw an error if the lock is held by another transaction.
        """
        now = utcnow()

        return session.query(cls).filter(
            cls.singleton.is_(True),
            or_(cls.last_checked.is_(None), cls.last_checked <= now - check_interval),
        ).with_for_update(nowait=True).one_or_none()

        Acquire an exclusive lock to perform an update check if the check is due
        and if another check is not already in progress.

        We use the database to hold the lock for as long as this transaction is open using `FOR UPDATE SKIP LOCKED`.

        This method will either return a row meaning the check is due and we
        have acquired the lock. The lock will be held for the duration of the
        database transaction -- be careful to to close this before you are
        done!

        This will throw an error if the lock is held by another transaction.
        
Acquire an exclusive lock to perform an update check if the check is due
and if another check is not already in progress.

We use the database to hold the lock for as long as this transaction is open using `FOR UPDATE SKIP LOCKED`.

This method will either return a row meaning the check is due and we
have acquired the lock. The lock will be held for the duration of the
database transaction -- be careful to to close this before you are
done!

This will throw an error if the lock is held by another transaction.
Acquire an exclusive lock to perform an update check if the check is due and if another check is not already in progress . We use the database to hold the lock for as long as this transaction is open using ` FOR UPDATE SKIP LOCKED ` . This method will either return a row meaning the check is due and we have acquired the lock . The lock will be held for the duration of the database transaction -- be careful to to close this before you are done! This will throw an error if the lock is held by another transaction .
def acquire_lock(cls, check_interval, session):  
        now = utcnow()
        return session.query(cls).filter(
            cls.singleton.is_(True),
            or_(cls.last_checked.is_(None), cls.last_checked <= now - check_interval),
        ).with_for_update(nowait=True).one_or_none()
def acquire_lock ( cls , check_interval , session ) : now = utcnow ( ) return session . query ( cls ) . filter ( cls . singleton . is_ ( True ) , or_ ( cls . last_checked . is_ ( None ) , cls . last_checked <= now - check_interval ) , ) . with_for_update ( nowait = True ) . one_or_none ( )
Acquire an exclusive lock to perform an update check if the check is due
and if another check is not already in progress.
Acquire an exclusive lock to perform an update check if the check is due and if another check is not already in progress .
# type: (datetime.timedelta, sqlalchemy.Session) -> Optional[AstronomerVersionCheck] """
        Acquire an exclusive lock to perform an update check if the check is due
        and if another check is not already in progress.

        We use the database to hold the lock for as long as this transaction is open using `FOR UPDATE SKIP LOCKED`.

        This method will either return a row meaning the check is due and we
        have acquired the lock. The lock will be held for the duration of the
        database transaction -- be careful to to close this before you are
        done!

        This will throw an error if the lock is held by another transaction.
        """
cls
check_interval
session