feat(config): 時間指定 suffix フォーマット実装 — 1d, 5m, 1h, 30s (issue #46)#51
Merged
liplus-lin-lay merged 2 commits intomainfrom Mar 5, 2026
Merged
feat(config): 時間指定 suffix フォーマット実装 — 1d, 5m, 1h, 30s (issue #46)#51liplus-lin-lay merged 2 commits intomainfrom
liplus-lin-lay merged 2 commits intomainfrom
Conversation
Add parseDurationMinutes() to config.go which accepts: 30s → 1 min (rounded up) 5m → 5 2h → 120 1d → 1440 plain integer → minutes (backward compatible) 0 → 0 (disabled) intMin / intGate now delegate to parseDurationMinutes so all four time-gate keys (UPDATE_TIME, DDNS_TIME, IP_CACHE_TIME, ERR_CHK_TIME) accept the new format. install.sh gains parse_duration_min() shell function to convert DDNS_TIME suffix format before writing OnUnitActiveSec. user.conf.example updated: UPDATE_TIME=1d, DDNS_TIME=5m with format comment explaining s/m/h/d suffixes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Negative plain integers (e.g. DDNS_TIME=-5) were previously rejected as invalid by parseDurationMinutes. Return sentinel -1 instead so intMin / intGate clamp them to the configured minimum, matching the behaviour of UPDATE_TIME=0 (clamped to 3) and keeping consistency with the test expectations in TestTimegateMinimum. Co-Authored-By: Claude Sonnet 4.6 <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.
概要
issue #43(仕様書)§3.2 / issue #34(元 dipper 設定ファイル)対応。
変更内容
config.go—parseDurationMinutes()追加1d2h5m30s5(整数)0intMin/intGateがこの関数を使うようになり、UPDATE_TIME,DDNS_TIME,IP_CACHE_TIME,ERR_CHK_TIMEの全キーで suffix が使える。scripts/install.sh—parse_duration_min()追加DDNS_TIME=5mのような suffix 形式を読んでタイマー間隔(分)に変換。user.conf.example更新Closes #46