Skip to content

Commit

Permalink
Create base Daemon class and refactor Undertaker to inherit from base…
Browse files Browse the repository at this point in the history
… class; rucio#6478

Initial commit where base class Daemon is created. As an initial test,
Undertaker inherits from Daemon. If tests pass, other daemons
can also be refactored to inherit from Daemon.
  • Loading branch information
rdimaio committed Feb 15, 2024
1 parent a6f76e6 commit 52b217e
Show file tree
Hide file tree
Showing 7 changed files with 339 additions and 193 deletions.
11 changes: 5 additions & 6 deletions bin/rucio-undertaker
Expand Up @@ -21,7 +21,7 @@ Undertaker is a daemon to manage expired did.
import argparse
import signal

from rucio.daemons.undertaker.undertaker import run, stop
from rucio.daemons.undertaker.undertaker import Undertaker


def get_parser():
Expand Down Expand Up @@ -66,12 +66,11 @@ Check if the DID exists::


if __name__ == "__main__":

signal.signal(signal.SIGTERM, stop)
parser = get_parser()
args = parser.parse_args()
undertaker = Undertaker(total_workers=args.total_workers, chunk_size=args.chunk_size, once=args.run_once, sleep_time=args.sleep_time)
signal.signal(signal.SIGTERM, undertaker.stop)
try:
run(total_workers=args.total_workers, chunk_size=args.chunk_size, once=args.run_once,
sleep_time=args.sleep_time)
undertaker.run()
except KeyboardInterrupt:
stop()
undertaker.stop()

0 comments on commit 52b217e

Please sign in to comment.