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


Release history Release notifications | RSS feed

This version

1.0

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.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

py_heart_locker-1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file py-heart-locker-1.0.tar.gz.

File metadata

  • Download URL: py-heart-locker-1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for py-heart-locker-1.0.tar.gz
Algorithm Hash digest
SHA256 5df75c72984d0ca58d86fb153395a8c34ed1548c7f435ad72b4a3c493365c0fe
MD5 8a8eb49b1f3c1c3b44c67014a87892ab
BLAKE2b-256 f99f069605db5e317962457e7d9b125fa7af8ee23de299eaffe04951055404eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_heart_locker-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1843bb0f90f971ae1831ac0b92f65d476cecedb88ef36ecf6bdad35c8efdd473
MD5 0c2c43c836cd2c6984362e2b0349ba3f
BLAKE2b-256 81cd902bd8393895e821c61acd362dab5a6f7ae9905f82007c50fd37a4575696

See more details on using hashes here.

Supported by

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