chore: remove time validation
All checks were successful
submodules sync / sync (push) Successful in 44s
build / build (push) Successful in 3m2s
build / trigger-build-image (push) Successful in 16s

This commit is contained in:
张泊明518370910136 2025-09-14 17:53:25 -07:00
parent e1e49fb05a
commit fce18b60cf
GPG Key ID: D47306D7062CDA9D
3 changed files with 5 additions and 32 deletions

View File

@ -13,7 +13,6 @@ import (
"path/filepath"
"regexp"
"strings"
"time"
"github.com/go-git/go-git/v5"
"github.com/koding/multiconfig"
@ -179,19 +178,6 @@ func GetConfPath(confRoot, confName, fallbackConfName, msg, tag string) (
return
}
func CheckValid(conf *Conf) error {
now := time.Now().Unix()
if conf.EffectiveUnixTimestamp > 0 &&
conf.EffectiveUnixTimestamp > now {
return fmt.Errorf("config file not effective now: %d", now)
}
if conf.ExpireUnixTimestamp > 0 &&
conf.ExpireUnixTimestamp < now {
return fmt.Errorf("config file expired now: %d", now)
}
return nil
}
func MatchGroups(conf *Conf, conventionalCommit *ConventionalCommit) []string {
seen := make(map[string]bool)
keywords := []string{}

View File

@ -24,8 +24,6 @@ type Conf struct {
Name string `default:"unknown"`
LogPath string `default:""`
ActorCsvPath string `default:""`
EffectiveUnixTimestamp int64 `default:"-1"`
ExpireUnixTimestamp int64 `default:"-1"`
MaxTotalScore int `default:"-1"`
Stage struct {
SandboxExecServer string `default:"localhost:5051"`

View File

@ -92,14 +92,6 @@ func showConfStat(confPath string, confStat fs.FileInfo) error {
return nil
}
func validateConf(conf *joj3Conf.Conf) error {
if err := joj3Conf.CheckValid(conf); err != nil {
slog.Error("conf not valid now", "error", err)
return err
}
return nil
}
func run(conf *joj3Conf.Conf, conventionalCommit *joj3Conf.ConventionalCommit) error {
groups := joj3Conf.MatchGroups(conf, conventionalCommit)
env.SetGroups(strings.Join(groups, ","))
@ -143,9 +135,6 @@ func mainImpl() (err error) {
if err := setupSlog(conf); err != nil {
return err
}
if err := validateConf(conf); err != nil {
return err
}
if err := run(conf, conventionalCommit); err != nil {
return err
}