DUNE-DAQ / drunc

Dune RUN Control (DRUNC) is the run control for the DUNE experiment
1 stars 1 forks source link

Make decorators async or sync based on arguments #56

Open plasorak opened 6 months ago

plasorak commented 6 months ago

... rather than having defined 2 decorators. For example: https://github.com/DUNE-DAQ/drunc/blob/develop/src/drunc/authoriser/decorators.py defines 2 decorators. They should really have the signature:

def authentified_and_authorised(action, system, async=False)
   def async_decor(): ...
   def sync_decor(): ...
   return sync_decor if not async else async_decor