|
@@ -17,7 +17,7 @@ import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
|
- flagInfoHelp = "Show application 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)"
|
|
@@ -28,7 +28,8 @@ const (
|
|
|
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).`
|
|
|
- flagCronjobHelp = "Run Miniflux as a cronjob to 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)"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// Parse parses command line arguments.
|
|
// Parse parses command line arguments.
|
|
@@ -46,7 +47,8 @@ func Parse() {
|
|
|
flagConfigFile string
|
|
flagConfigFile string
|
|
|
flagConfigDump bool
|
|
flagConfigDump bool
|
|
|
flagHealthCheck string
|
|
flagHealthCheck string
|
|
|
- flagCronjob bool
|
|
|
|
|
|
|
+ flagRefreshFeeds bool
|
|
|
|
|
+ flagRunCleanupTasks bool
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
flag.BoolVar(&flagInfo, "info", false, flagInfoHelp)
|
|
flag.BoolVar(&flagInfo, "info", false, flagInfoHelp)
|
|
@@ -63,7 +65,8 @@ func Parse() {
|
|
|
flag.StringVar(&flagConfigFile, "c", "", flagConfigFileHelp)
|
|
flag.StringVar(&flagConfigFile, "c", "", flagConfigFileHelp)
|
|
|
flag.BoolVar(&flagConfigDump, "config-dump", false, flagConfigDumpHelp)
|
|
flag.BoolVar(&flagConfigDump, "config-dump", false, flagConfigDumpHelp)
|
|
|
flag.StringVar(&flagHealthCheck, "healthcheck", "", flagHealthCheckHelp)
|
|
flag.StringVar(&flagHealthCheck, "healthcheck", "", flagHealthCheckHelp)
|
|
|
- flag.BoolVar(&flagCronjob, "cronjob", false, flagCronjobHelp)
|
|
|
|
|
|
|
+ flag.BoolVar(&flagRefreshFeeds, "refresh-feeds", false, flagRefreshFeedsHelp)
|
|
|
|
|
+ flag.BoolVar(&flagRunCleanupTasks, "run-cleanup-tasks", false, flagRunCleanupTasksHelp)
|
|
|
flag.Parse()
|
|
flag.Parse()
|
|
|
|
|
|
|
|
cfg := config.NewParser()
|
|
cfg := config.NewParser()
|
|
@@ -190,8 +193,13 @@ func Parse() {
|
|
|
createAdmin(store)
|
|
createAdmin(store)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if flagCronjob {
|
|
|
|
|
- runCronjob(store)
|
|
|
|
|
|
|
+ if flagRefreshFeeds {
|
|
|
|
|
+ refreshFeeds(store)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if flagRunCleanupTasks {
|
|
|
|
|
+ runCleanupTasks(store)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|