Metadata-Version: 2.4
Name: cronalive
Version: 0.2.0
Summary: CronAlive heartbeat monitoring: ping helper, decorator and CLI wrapper
Project-URL: Documentation, https://cronalive.com/en/docs/
Project-URL: Source, https://github.com/opopeshku/cronalive
License: MIT
License-File: LICENSE
Keywords: cron,healthcheck,heartbeat,monitoring,uptime
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# cronalive

Heartbeat monitoring for cron jobs and scripts with [CronAlive](https://cronalive.com):
if a job stops pinging on schedule, you get an alert.

Pings never raise — monitoring must not break the monitored job.

## Install

```bash
pip install cronalive
```

The ping domain can be overridden with the `CRONALIVE_PING_DOMAIN` env variable.

## Usage

```python
import cronalive

# plain pings (fire-and-forget, never raise):
cronalive.ping("<uuid>")          # success
cronalive.ping("<uuid>", "fail")  # explicit failure

# decorator: /start before the call, success or /fail after it —
# CronAlive also measures the job duration:
@cronalive.monitor("<uuid>")
def nightly_job():
    ...
```

CLI wrapper — run any command under monitoring (sends `/start`, then the
exit code; 0 = success):

```bash
cronalive run --id <uuid> -- /usr/local/bin/backup.sh --fast
```

## Pings never hold your job

Signals are sent inline, around the job you actually care about, so they
carry a short explicit timeout (`cronalive.TIMEOUT`, 2 seconds) covering
both the connect and the read. An unreachable — or worse, a hung — ping
domain costs the job a couple of seconds, not the default socket wait.

A failed signal is swallowed and never retried: a retry would only double
the delay, and the next run sends a fresh ping anyway.

## Docs

Full documentation: <https://cronalive.com/en/docs/> (Russian: <https://cronalive.com/docs/>).

## License

MIT
