Skip to content

Commit

Permalink
Rename poll to refresh in config
Browse files Browse the repository at this point in the history
  • Loading branch information
podliashanyk committed May 22, 2024
1 parent 41d94f8 commit fbd4369
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ All config options can be overruled by environment variables. Prefix with
options. It is also possible to override logging by setting "HOWITZ_LOGGING" to
a string of a python dict but we do not recommend it, use a config file instead.

Poll interval for events table can be changed by adding for example ``poll_interval = 30`` to
the ``[howitz]``-section or setting the environment variable ``HOWITZ_POLL_INTERVAL`` to a new value.
Poll interval values represented seconds and must be integers. The default value is ``60`` seconds.
Refresh interval for events table can be changed by adding for example ``refresh_interval = 30`` to
the ``[howitz]``-section or setting the environment variable ``HOWITZ_REFRESH_INTERVAL`` to a new value.
Refresh interval values represented seconds and must be integers. The default value is ``60`` seconds.

Debugging can be turned on either by adding ``DEBUG = true`` to the
``[flask]``-section or setting the environment variable ``HOWITZ_DEBUG`` to ``1``.
Expand Down
2 changes: 1 addition & 1 deletion dev-howitz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEBUG = true
[howitz]
storage = "./howitz.sqlite3"
devmode = true
poll_interval = 30
refresh_interval = 30
timezone='LOCAL'

[zino.connections.default]
Expand Down
4 changes: 2 additions & 2 deletions src/howitz/config/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ class DevStorageConfig(StorageConfig):

class HowitzConfig(ServerConfig, StorageConfig):
devmode: bool = Literal[False]
poll_interval: int = 60
refresh_interval: int = 60
timezone: str = DEFAULT_TIMEZONE


class DevHowitzConfig(DevServerConfig, DevStorageConfig):
devmode: bool = Literal[True]
poll_interval: int = 30
refresh_interval: int = 30
timezone: str = DEFAULT_TIMEZONE
4 changes: 2 additions & 2 deletions src/howitz/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def footer():
elif not tz == DEFAULT_TIMEZONE: # Fall back to default if invalid value is provided
tz = f"{DEFAULT_TIMEZONE} (default)"

return render_template('/components/footer/footer-info.html', poll_interval=current_app.howitz_config["poll_interval"],
return render_template('/components/footer/footer-info.html', poll_interval=current_app.howitz_config["refresh_interval"],
timezone=tz)


Expand Down Expand Up @@ -350,7 +350,7 @@ def auth():
@main.route('/events-table.html')
def events_table():
return render_template('/components/table/events-table.html',
poll_interval=current_app.howitz_config["poll_interval"])
poll_interval=current_app.howitz_config["refresh_interval"])


@main.route('/get_events')
Expand Down

0 comments on commit fbd4369

Please sign in to comment.