Added --since to job-search serve, for the sources it fetches from

This commit is contained in:
bwilliams committed 2026-10-16 11:30:56 +01:00
1 parent b3d20c1db0
commit 3c4fde8dfd
1 file changed
+10 -1
+10 -1
View File
@@ -48,6 +48,7 @@ sources.`,
portOverride, _ := cmd.Flags().GetInt("port")
foreground, _ := cmd.Flags().GetBool("foreground")
accessLogOverride, _ := cmd.Flags().GetString("access-log")
since, _ := cmd.Flags().GetTime("since")
if addrOverride != "" {
listenParts := strings.Split(addrOverride, ":")
@@ -138,7 +139,7 @@ sources.`,
sourceFetcher := fetcher.New(&conf.Sources, fetcherOptions...)
fetcherDone := make(chan error, 1)
go func() {
fetchErr := sourceFetcher.Run(runCtx, time.Time{})
fetchErr := sourceFetcher.Run(runCtx, since)
// Only a failure stops the server: with no sources enabled, Run
// returns nil straight away.
if fetchErr != nil {
@@ -169,6 +170,14 @@ sources.`,
`access log file, or "-" for stdout; "" for none `+
"(default from config, server.access_log)",
)
flags.Time(
"since",
time.Time{},
[]string{
time.DateOnly, time.DateTime,
},
"contract updates published since YYYY-MM-DD[ hh:mm:ss]",
)
cmd.MarkFlagsMutuallyExclusive("listen", "host")
cmd.MarkFlagsMutuallyExclusive("listen", "port")