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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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