Skip to content

Commit

Permalink
feat: add a simple cron task
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-fully-ported authored Jan 10, 2024
1 parent 2788d8e commit 3d76418
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cron.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""
starts a one-off process
"""
import signal
import time

from shared import consume_cpu, consume_memory, handle_signal, is_exiting


def main():
"""
starts a no-op task that consumes resources
"""
print("consuming cpu")
consume_cpu()
print("consuming memory")
consume_memory()
print("sleeping for 10 seconds")
time.sleep(10)


if __name__ == "__main__":
signal.signal(signal.SIGTERM, handle_signal)

main()

0 comments on commit 3d76418

Please sign in to comment.