From 9f67aa8e4c2ed24d4a584c3f6b34a17906c659a5 Mon Sep 17 00:00:00 2001 From: Darin Krauss Date: Wed, 7 Feb 2024 13:24:48 -0800 Subject: [PATCH] Increase Dexcom task duration maximum and available period - Minor changes for local debugging --- .vscode/launch.json | 34 ++++++++++++++-------------------- application/provider.go | 4 ++-- dexcom/fetch/runner.go | 6 +++--- 3 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index dd1f1a89fd..27a9a4886f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -6,11 +6,9 @@ "type": "go", "request": "launch", "mode": "debug", - "host": "127.0.0.1", - "port": 19222, "program": "${workspaceRoot}/services/auth", - "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application/version.Base=0.0.0 -X github.com/tidepool-org/platform/application/version.ShortCommit=00000000 -X github.com/tidepool-org/platform/application/version.FullCommit=0000000000000000000000000000000000000000'", - "envFile": "${workspaceRoot}/env.sh", + "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'", + "envFile": "${workspaceRoot}/auth.env", "env": { "TIDEPOOL_DEBUG_NAME": "auth" } @@ -20,11 +18,9 @@ "type": "go", "request": "launch", "mode": "debug", - "host": "127.0.0.1", - "port": 19220, "program": "${workspaceRoot}/services/data", - "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application/version.Base=0.0.0 -X github.com/tidepool-org/platform/application/version.ShortCommit=00000000 -X github.com/tidepool-org/platform/application/version.FullCommit=0000000000000000000000000000000000000000'", - "envFile": "${workspaceRoot}/env.sh", + "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'", + "envFile": "${workspaceRoot}/data.env", "env": { "TIDEPOOL_DEBUG_NAME": "data" } @@ -34,11 +30,9 @@ "type": "go", "request": "launch", "mode": "debug", - "host": "127.0.0.1", - "port": 19223, "program": "${workspaceRoot}/services/notification", - "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application/version.Base=0.0.0 -X github.com/tidepool-org/platform/application/version.ShortCommit=00000000 -X github.com/tidepool-org/platform/application/version.FullCommit=0000000000000000000000000000000000000000'", - "envFile": "${workspaceRoot}/env.sh", + "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'", + "envFile": "${workspaceRoot}/notification.env", "env": { "TIDEPOOL_DEBUG_NAME": "notification" } @@ -48,11 +42,9 @@ "type": "go", "request": "launch", "mode": "debug", - "host": "127.0.0.1", - "port": 19224, "program": "${workspaceRoot}/services/task", - "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application/version.Base=0.0.0 -X github.com/tidepool-org/platform/application/version.ShortCommit=00000000 -X github.com/tidepool-org/platform/application/version.FullCommit=0000000000000000000000000000000000000000'", - "envFile": "${workspaceRoot}/env.sh", + "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'", + "envFile": "${workspaceRoot}/task.env", "env": { "TIDEPOOL_DEBUG_NAME": "task" } @@ -62,17 +54,19 @@ "type": "go", "request": "launch", "mode": "debug", - "host": "127.0.0.1", - "port": 19221, "program": "${workspaceRoot}/services/user", - "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application/version.Base=0.0.0 -X github.com/tidepool-org/platform/application/version.ShortCommit=00000000 -X github.com/tidepool-org/platform/application/version.FullCommit=0000000000000000000000000000000000000000'", - "envFile": "${workspaceRoot}/env.sh", + "buildFlags": "-ldflags '-X github.com/tidepool-org/platform/application.VersionBase=0.0.0 -X github.com/tidepool-org/platform/application.VersionShortCommit=00000000 -X github.com/tidepool-org/platform/application.VersionFullCommit=0000000000000000000000000000000000000000'", + "envFile": "${workspaceRoot}/user.env", "env": { "TIDEPOOL_DEBUG_NAME": "user" } } ], "compounds": [ + { + "name": "auth, task", + "configurations": ["auth", "task"] + }, { "name": "auth, data, task", "configurations": ["auth", "data", "task"] diff --git a/application/provider.go b/application/provider.go index 736d681114..8d742e8e7a 100644 --- a/application/provider.go +++ b/application/provider.go @@ -88,8 +88,8 @@ func NewProvider(prefix string, scopes ...string) (*ProviderImpl, error) { } name := filepath.Base(os.Args[0]) - if strings.EqualFold(name, "debug") { - name = configReporter.WithScopes(name).GetWithDefault("name", name) + if strings.EqualFold(name, "debug") || strings.HasPrefix(name, "__debug_bin") { + name = configReporter.WithScopes("debug").GetWithDefault("name", name) } configReporter = configReporter.WithScopes(name).WithScopes(scopes...) diff --git a/dexcom/fetch/runner.go b/dexcom/fetch/runner.go index ceb727098a..59360116b3 100644 --- a/dexcom/fetch/runner.go +++ b/dexcom/fetch/runner.go @@ -26,10 +26,10 @@ import ( ) const ( - AvailableAfterDurationMaximum = 75 * time.Minute - AvailableAfterDurationMinimum = 45 * time.Minute + AvailableAfterDurationMaximum = 135 * time.Minute + AvailableAfterDurationMinimum = 105 * time.Minute DataSetSize = 2000 - TaskDurationMaximum = 5 * time.Minute + TaskDurationMaximum = 10 * time.Minute ) var initialDataTime = time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC)