Skip to main content

Python process locker to avoid repeatedly executing the same script at the same time

Project description

py-heart-locker

python 进程锁定器,避免同一时间重复执行相同的脚本


运行环境

使用说明

  1. 安装: python -m pip install py-heart-locker
  2. 在代码中使用:
from lock import locker

def main() :
    if locker.islocked() :
        return
    locker.lock()

    core()


def core() :
    # 业务核心代码


if __name__ == '__main__' :
    main()
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py_heart_locker-1.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py_heart_locker-1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file py_heart_locker-1.1.tar.gz.

File metadata

  • Download URL: py_heart_locker-1.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for py_heart_locker-1.1.tar.gz
Algorithm Hash digest
SHA256 d600304ff1e50c4338d17f067d61eef5eb2dd76873dd5d9c6f42f26047be767a
MD5 ab81fc4ace2bae1f7d7ef81a2b88f283
BLAKE2b-256 60593a433ec5eccd7e6a8f6bb7914f08dcbc0f6212ef2cd7f38bb36b62edc224

See more details on using hashes here.

File details

Details for the file py_heart_locker-1.1-py3-none-any.whl.

File metadata

  • Download URL: py_heart_locker-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for py_heart_locker-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98d6a3a5acd93e1d967a08164046dad708dbaa286a851a718bc9c8b592f11f33
MD5 ab19743efb6eb64d8389225c4e64c480
BLAKE2b-256 b50c21123297fb2066b4222a8f0131070cd843d05aa611dbabbe3f49ea1cfaa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page