Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make plugin refresh interval configurable #360

Merged
merged 1 commit into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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