plex: add webhook healthcheck against active sessions#1196
Open
nicholaskurjo wants to merge 1 commit into
Open
plex: add webhook healthcheck against active sessions#1196nicholaskurjo wants to merge 1 commit into
nicholaskurjo wants to merge 1 commit into
Conversation
| cfg := defaultWebhookHealthConfig() | ||
|
|
||
| if !cfg.Enabled { | ||
| t.Fatal("expected default webhook health config to be enabled") |
Contributor
There was a problem hiding this comment.
Tell your AI to use testify.
| "time" | ||
| ) | ||
|
|
||
| func TestShouldAlertForStaleWebhook(t *testing.T) { |
Contributor
There was a problem hiding this comment.
You can add an override for test files in .golangci-lint.yml to ignore the funlen linter.
| @@ -0,0 +1,102 @@ | |||
| package plexcron | |||
Contributor
There was a problem hiding this comment.
Suggested change
| package plexcron | |
| package plexcron_test |
See if you can make the tests work like this. It's not mandatory, but if you don't then you need to make the linter shut up.
| Payload: &website.Payload{ | ||
| Snap: c.getMetaSnap(ctx), | ||
| Plex: sessions, | ||
| Load: hook, |
Contributor
There was a problem hiding this comment.
This payload structure you created int's going to work out. I'll figure out what we need...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
startAt,lastWebhookAt,lastAlertAt)webhookHealthEnabledwebhookStaleAfterwebhookAlertCooldownwebhookStartupGraceBehavior
A health alert is sent only when:
Tests
pkg/triggers/plexcron/webhook_health_test.gowith decision-logic coverage:go test ./pkg/triggers/plexcrongo test ./pkg/clientgo test ./pkg/apps/apppkg/plexCloses #1131