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

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 Jan 26, 2024
1 parent a6f76e6 commit 33b8daa
Show file tree
Hide file tree
Showing 7 changed files with 345 additions and 197 deletions.
11 changes: 4 additions & 7 deletions bin/rucio-undertaker
Expand Up @@ -19,9 +19,8 @@ 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 +65,10 @@ 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)
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 33b8daa

Please sign in to comment.