Skip to content

Commit

Permalink
error message for timeout; increase rules update interval
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimryndin committed Feb 4, 2024
1 parent ce16137 commit e953108
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* rules are applied also at shutdown
* a welcome service message is sent to a service messenger instead of a general service messenger
* rules update warn is sent to a service messenger first
* rules update interval is increased

* 0.1.1
* no panic for Google API access failure - just send an error to a messenger
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ Another notable use case is to log console errors from the frontend - catch JS e
Every service automatically creates a rules sheet (for some services reasonable defaults are provided) which allows you to set notifications (via configured messengers) on the data as it is collected.
Datetime for rules is optional and is set only for default rules. You choose a log name (everything up to the first `@` in a sheet title) and a key (a column header of a sheet), select a condition which is checked, and an action: either send info/warn/error message or skip the rule's match from any further rules processing.

Rules are fetched from a rules sheet by every Goral service dynamically every 15-31 seconds (the period is jittered to prevent hitting the Google quota).
Rules are fetched from a rules sheet by every Goral service dynamically every 30-46 seconds (the period is jittered to prevent hitting the Google quota).

## Recommended deployment

Expand Down
2 changes: 1 addition & 1 deletion src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub trait Service: Send + Sync {
}

fn rules_update_interval(&self) -> Duration {
Duration::from_secs(15) + jitter_duration()
Duration::from_secs(30) + jitter_duration()
}

fn get_example_rules(&self) -> Vec<Datarow> {
Expand Down
1 change: 1 addition & 0 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ impl AppendableLog {
_ = &mut max_backoff => {break;}
_ = tokio::time::sleep(timeout) => {
tracing::warn!("No response from Google API for timeout {:?} for retry {} for service `{}`", timeout, retry, self.service);
last_retry_error = format!("timeout {:?}", timeout);
},
res = self.fetch_sheets() => {
if let Err(StorageError::Retriable(e)) = res {
Expand Down

0 comments on commit e953108

Please sign in to comment.