[RFE] Periodic tasks: Allow passing a function callback to the spacing parameter

Bug #1622612 reported by Lucas Alvares Gomes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
futurist
Wishlist
Unassigned

Bug Description

We could allow passing a function callback to the "spacing" parameter of the @periodic decorator, that would make it more flexible and would enable things like refreshing the interval values when the service re-loads the configuration file (in case of a SIGHUP). For example:

 def _sync_states():
    return CONF.sync_states_interval

 class Foo(object):

     @periodics.periodic(spacing=_sync_states)
     def sync_states(self):
         ...

Alternatively we could have another parameter for that as well, "spacing_func" maybe?

description: updated
Ben Nemec (bnemec)
Changed in futurist:
status: New → Confirmed
importance: Undecided → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers