mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
feat(cli): add -reset-feed-next-check-at
argument
This commit is contained in:
parent
28d0185e79
commit
d139d8a6ce
3 changed files with 55 additions and 32 deletions
|
@ -20,40 +20,42 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
flagInfoHelp = "Show build information"
|
flagInfoHelp = "Show build information"
|
||||||
flagVersionHelp = "Show application version"
|
flagVersionHelp = "Show application version"
|
||||||
flagMigrateHelp = "Run SQL migrations"
|
flagMigrateHelp = "Run SQL migrations"
|
||||||
flagFlushSessionsHelp = "Flush all sessions (disconnect users)"
|
flagFlushSessionsHelp = "Flush all sessions (disconnect users)"
|
||||||
flagCreateAdminHelp = "Create an admin user from an interactive terminal"
|
flagCreateAdminHelp = "Create an admin user from an interactive terminal"
|
||||||
flagResetPasswordHelp = "Reset user password"
|
flagResetPasswordHelp = "Reset user password"
|
||||||
flagResetFeedErrorsHelp = "Clear all feed errors for all users"
|
flagResetFeedErrorsHelp = "Clear all feed errors for all users"
|
||||||
flagDebugModeHelp = "Show debug logs"
|
flagDebugModeHelp = "Show debug logs"
|
||||||
flagConfigFileHelp = "Load configuration file"
|
flagConfigFileHelp = "Load configuration file"
|
||||||
flagConfigDumpHelp = "Print parsed configuration values"
|
flagConfigDumpHelp = "Print parsed configuration values"
|
||||||
flagHealthCheckHelp = `Perform a health check on the given endpoint (the value "auto" try to guess the health check endpoint).`
|
flagHealthCheckHelp = `Perform a health check on the given endpoint (the value "auto" try to guess the health check endpoint).`
|
||||||
flagRefreshFeedsHelp = "Refresh a batch of feeds and exit"
|
flagRefreshFeedsHelp = "Refresh a batch of feeds and exit"
|
||||||
flagRunCleanupTasksHelp = "Run cleanup tasks (delete old sessions and archives old entries)"
|
flagRunCleanupTasksHelp = "Run cleanup tasks (delete old sessions and archives old entries)"
|
||||||
flagExportUserFeedsHelp = "Export user feeds (provide the username as argument)"
|
flagExportUserFeedsHelp = "Export user feeds (provide the username as argument)"
|
||||||
|
flagResetNextCheckAtHelp = "Reset the next check time for all feeds"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Parse parses command line arguments.
|
// Parse parses command line arguments.
|
||||||
func Parse() {
|
func Parse() {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
flagInfo bool
|
flagInfo bool
|
||||||
flagVersion bool
|
flagVersion bool
|
||||||
flagMigrate bool
|
flagMigrate bool
|
||||||
flagFlushSessions bool
|
flagFlushSessions bool
|
||||||
flagCreateAdmin bool
|
flagCreateAdmin bool
|
||||||
flagResetPassword bool
|
flagResetPassword bool
|
||||||
flagResetFeedErrors bool
|
flagResetFeedErrors bool
|
||||||
flagDebugMode bool
|
flagResetFeedNextCheckAt bool
|
||||||
flagConfigFile string
|
flagDebugMode bool
|
||||||
flagConfigDump bool
|
flagConfigFile string
|
||||||
flagHealthCheck string
|
flagConfigDump bool
|
||||||
flagRefreshFeeds bool
|
flagHealthCheck string
|
||||||
flagRunCleanupTasks bool
|
flagRefreshFeeds bool
|
||||||
flagExportUserFeeds string
|
flagRunCleanupTasks bool
|
||||||
|
flagExportUserFeeds string
|
||||||
)
|
)
|
||||||
|
|
||||||
flag.BoolVar(&flagInfo, "info", false, flagInfoHelp)
|
flag.BoolVar(&flagInfo, "info", false, flagInfoHelp)
|
||||||
|
@ -65,6 +67,7 @@ func Parse() {
|
||||||
flag.BoolVar(&flagCreateAdmin, "create-admin", false, flagCreateAdminHelp)
|
flag.BoolVar(&flagCreateAdmin, "create-admin", false, flagCreateAdminHelp)
|
||||||
flag.BoolVar(&flagResetPassword, "reset-password", false, flagResetPasswordHelp)
|
flag.BoolVar(&flagResetPassword, "reset-password", false, flagResetPasswordHelp)
|
||||||
flag.BoolVar(&flagResetFeedErrors, "reset-feed-errors", false, flagResetFeedErrorsHelp)
|
flag.BoolVar(&flagResetFeedErrors, "reset-feed-errors", false, flagResetFeedErrorsHelp)
|
||||||
|
flag.BoolVar(&flagResetFeedNextCheckAt, "reset-feed-next-check-at", false, flagResetNextCheckAtHelp)
|
||||||
flag.BoolVar(&flagDebugMode, "debug", false, flagDebugModeHelp)
|
flag.BoolVar(&flagDebugMode, "debug", false, flagDebugModeHelp)
|
||||||
flag.StringVar(&flagConfigFile, "config-file", "", flagConfigFileHelp)
|
flag.StringVar(&flagConfigFile, "config-file", "", flagConfigFileHelp)
|
||||||
flag.StringVar(&flagConfigFile, "c", "", flagConfigFileHelp)
|
flag.StringVar(&flagConfigFile, "c", "", flagConfigFileHelp)
|
||||||
|
@ -190,7 +193,16 @@ func Parse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if flagResetFeedErrors {
|
if flagResetFeedErrors {
|
||||||
store.ResetFeedErrors()
|
if err := store.ResetFeedErrors(); err != nil {
|
||||||
|
printErrorAndExit(err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if flagResetFeedNextCheckAt {
|
||||||
|
if err := store.ResetNextCheckAt(); err != nil {
|
||||||
|
printErrorAndExit(err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -485,3 +485,8 @@ func (s *Storage) ResetFeedErrors() error {
|
||||||
_, err := s.db.Exec(`UPDATE feeds SET parsing_error_count=0, parsing_error_msg=''`)
|
_, err := s.db.Exec(`UPDATE feeds SET parsing_error_count=0, parsing_error_msg=''`)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Storage) ResetNextCheckAt() error {
|
||||||
|
_, err := s.db.Exec(`UPDATE feeds SET next_check_at=now()`)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
10
miniflux.1
10
miniflux.1
|
@ -5,8 +5,9 @@
|
||||||
miniflux \- Minimalist and opinionated feed reader
|
miniflux \- Minimalist and opinionated feed reader
|
||||||
|
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
\fBminiflux\fR [-vic] [-config-dump] [-config-file] [-create-admin] [-debug] [-flush-sessions]
|
\fBminiflux\fR [-vic] [-config-dump] [-config-file] [-create-admin] [-debug]
|
||||||
[-healthcheck] [-info] [-migrate] [-refresh-feeds] [-reset-feed-errors] [-reset-password]
|
[-flush-sessions] [-healthcheck] [-info] [-migrate] [-refresh-feeds]
|
||||||
|
[-reset-feed-errors] [-reset-feed-next-check-at] [-reset-password]
|
||||||
[-run-cleanup-tasks] [-version]
|
[-run-cleanup-tasks] [-version]
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
|
@ -83,6 +84,11 @@ Refresh a batch of feeds and exit\&.
|
||||||
Clear all feed errors for all users\&.
|
Clear all feed errors for all users\&.
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.PP
|
||||||
|
.B \-reset-feed-next-check-at
|
||||||
|
.RS 4
|
||||||
|
Reset the next check time for all feeds\&.
|
||||||
|
.RE
|
||||||
|
.PP
|
||||||
.B \-reset-password
|
.B \-reset-password
|
||||||
.RS 4
|
.RS 4
|
||||||
Reset user password\&.
|
Reset user password\&.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue