feat(config): add GOCLAW_CRON_JOB_TIMEOUT env var for cron timeout#1099
Open
hoakhongmau98 wants to merge 1 commit intonextlevelbuilder:devfrom
Open
feat(config): add GOCLAW_CRON_JOB_TIMEOUT env var for cron timeout#1099hoakhongmau98 wants to merge 1 commit intonextlevelbuilder:devfrom
hoakhongmau98 wants to merge 1 commit intonextlevelbuilder:devfrom
Conversation
Allow overriding the cron job execution timeout via env var, matching the existing GOCLAW_* env var pattern used throughout the codebase. Falls back to the existing default (10m) when unset or invalid, since CronConfig.JobTimeoutDuration() already handles parse errors with a slog.Warn and the DefaultJobTimeout constant. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
GOCLAW_CRON_JOB_TIMEOUTenv var mapping inapplyEnvOverrides(), completing theGOCLAW_*env var pattern forCronConfig.JobTimeout.DefaultJobTimeout(10m) behavior via the existingJobTimeoutDuration()helper, which already handles parse errors withslog.Warn.Closes #1098
Changes
internal/config/config_load.go— one new section in the operational-config block (next to Browser):internal/config/config_load_test.go— 4 new test cases:TestLoad_CronJobTimeout_EnvVar—GOCLAW_CRON_JOB_TIMEOUT=1h→1hTestLoad_CronJobTimeout_Invalid_FallsBackToDefault— invalid value → 10m (logs warn)TestLoad_CronJobTimeout_Unset_UsesDefault— unset → 10mTestLoad_CronJobTimeout_EnvOverridesFile— file5m+ env30m→30m(env wins)Test plan
go build ./...(PG build)go build -tags sqliteonly ./...(Desktop/SQLite build)go vet ./...go test ./internal/config/— 4 new + all existing tests passGOCLAW_CRON_JOB_TIMEOUT=1hand confirm a long cron job is no longer killed at 10mNotes for reviewers
CronConfig.JobTimeoutDuration()already validates and falls back. This was confirmed by the existingTestCronConfig_JobTimeoutDuration_Invalidtest.