Skip to content

Commit

Permalink
fix: Fix clientDefaults interface
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed May 10, 2024
1 parent 35a6418 commit 963fc79
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 26 deletions.
6 changes: 5 additions & 1 deletion src/backend/common/infrastructure/config/aioConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { LogOptions } from "@foxxmd/logging";
import { ClientAIOConfig } from "./client/clients.js";
import { CommonClientOptions } from "./client/index.js";
import { RequestRetryOptions } from "./common.js";
import { WebhookConfig } from "./health/webhooks.js";
import { CommonSourceOptions, SourceRetryOptions } from "./source/index.js";
Expand All @@ -9,9 +10,12 @@ import { SourceAIOConfig } from "./source/sources.js";
export interface SourceDefaults extends CommonSourceOptions {
}

export interface ClientDefaults extends CommonClientOptions {
}

export interface AIOConfig {
sourceDefaults?: SourceDefaults
clientDefaults?: RequestRetryOptions
clientDefaults?: ClientDefaults
sources?: SourceAIOConfig[]
clients?: ClientAIOConfig[]

Expand Down
88 changes: 63 additions & 25 deletions src/backend/common/schema/aio.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,68 @@
],
"title": "ClientAIOConfig"
},
"ClientDefaults": {
"properties": {
"checkExistingScrobbles": {
"default": true,
"description": "Check client for an existing scrobble at the same recorded time as the \"new\" track to be scrobbled. If an existing scrobble is found this track is not track scrobbled.",
"examples": [
true
],
"title": "checkExistingScrobbles",
"type": "boolean"
},
"deadLetterRetries": {
"default": 1,
"description": "Number of times MS should automatically retry scrobbles in dead letter queue",
"examples": [
1
],
"title": "deadLetterRetries",
"type": "number"
},
"maxRequestRetries": {
"default": 1,
"description": "default # of http request retries a source/client can make before error is thrown",
"examples": [
1
],
"title": "maxRequestRetries",
"type": "number"
},
"refreshEnabled": {
"default": true,
"description": "Try to get fresh scrobble history from client when tracks to be scrobbled are newer than the last scrobble found in client history",
"examples": [
true
],
"title": "refreshEnabled",
"type": "boolean"
},
"retryMultiplier": {
"default": 1.5,
"description": "default retry delay multiplier (retry attempt * multiplier = # of seconds to wait before retrying)",
"examples": [
1.5
],
"title": "retryMultiplier",
"type": "number"
},
"verbose": {
"description": "Options used for increasing verbosity of logging in MS (used for debugging)",
"properties": {
"match": {
"$ref": "#/definitions/MatchLoggingOptions",
"title": "match"
}
},
"title": "verbose",
"type": "object"
}
},
"title": "ClientDefaults",
"type": "object"
},
"CommonClientData": {
"title": "CommonClientData",
"type": "object"
Expand Down Expand Up @@ -2078,30 +2140,6 @@
"title": "PrioritiesConfig",
"type": "object"
},
"RequestRetryOptions": {
"properties": {
"maxRequestRetries": {
"default": 1,
"description": "default # of http request retries a source/client can make before error is thrown",
"examples": [
1
],
"title": "maxRequestRetries",
"type": "number"
},
"retryMultiplier": {
"default": 1.5,
"description": "default retry delay multiplier (retry attempt * multiplier = # of seconds to wait before retrying)",
"examples": [
1.5
],
"title": "retryMultiplier",
"type": "number"
}
},
"title": "RequestRetryOptions",
"type": "object"
},
"ScrobbleThresholds": {
"properties": {
"duration": {
Expand Down Expand Up @@ -2756,7 +2794,7 @@
"type": "string"
},
"clientDefaults": {
"$ref": "#/definitions/RequestRetryOptions",
"$ref": "#/definitions/ClientDefaults",
"title": "clientDefaults"
},
"clients": {
Expand Down

0 comments on commit 963fc79

Please sign in to comment.