Skip to content

Commit

Permalink
feat: make plugin refresh interval configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Feb 5, 2020
1 parent 4dcc0e6 commit bb040d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions synse_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
)),
DictOption('cache', default=None, scheme=Scheme(
DictOption('device', scheme=Scheme(
Option('rebuild_every', default=180, field_type=int) # three minutes
Option('rebuild_every', default=180, field_type=int), # three minutes
)),
DictOption('plugin', scheme=Scheme(
Option('refresh_every', default=120, field_type=int), # two minutes
)),
DictOption('transaction', scheme=Scheme(
Option('ttl', default=300, field_type=int) # five minutes
Option('ttl', default=300, field_type=int), # five minutes
))
)),
DictOption('grpc', scheme=Scheme(
Expand Down
2 changes: 1 addition & 1 deletion synse_server/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ async def _rebuild_device_cache() -> None:

async def _refresh_plugins() -> None:
"""Periodically refresh the plugin manager."""
interval = 2 * 60 # 2 minutes
interval = config.options.get('cache.plugin.refresh_every', 2 * 60) # 2 minute default

while True:
logger.info(
Expand Down

0 comments on commit bb040d6

Please sign in to comment.