|
@@ -27,6 +27,7 @@ const (
|
|
|
defaultDatabaseMaxConns = 20
|
|
defaultDatabaseMaxConns = 20
|
|
|
defaultDatabaseMinConns = 1
|
|
defaultDatabaseMinConns = 1
|
|
|
defaultArchiveReadDays = 60
|
|
defaultArchiveReadDays = 60
|
|
|
|
|
+ defaultRemoveSessionsDays = 30
|
|
|
defaultListenAddr = "127.0.0.1:8080"
|
|
defaultListenAddr = "127.0.0.1:8080"
|
|
|
defaultCertFile = ""
|
|
defaultCertFile = ""
|
|
|
defaultKeyFile = ""
|
|
defaultKeyFile = ""
|
|
@@ -67,6 +68,7 @@ type Options struct {
|
|
|
certKeyFile string
|
|
certKeyFile string
|
|
|
cleanupFrequency int
|
|
cleanupFrequency int
|
|
|
archiveReadDays int
|
|
archiveReadDays int
|
|
|
|
|
+ removeSessionsDays int
|
|
|
pollingFrequency int
|
|
pollingFrequency int
|
|
|
batchSize int
|
|
batchSize int
|
|
|
workerPoolSize int
|
|
workerPoolSize int
|
|
@@ -105,6 +107,7 @@ func NewOptions() *Options {
|
|
|
certKeyFile: defaultKeyFile,
|
|
certKeyFile: defaultKeyFile,
|
|
|
cleanupFrequency: defaultCleanupFrequency,
|
|
cleanupFrequency: defaultCleanupFrequency,
|
|
|
archiveReadDays: defaultArchiveReadDays,
|
|
archiveReadDays: defaultArchiveReadDays,
|
|
|
|
|
+ removeSessionsDays: defaultRemoveSessionsDays,
|
|
|
pollingFrequency: defaultPollingFrequency,
|
|
pollingFrequency: defaultPollingFrequency,
|
|
|
batchSize: defaultBatchSize,
|
|
batchSize: defaultBatchSize,
|
|
|
workerPoolSize: defaultWorkerPoolSize,
|
|
workerPoolSize: defaultWorkerPoolSize,
|
|
@@ -271,6 +274,11 @@ func (o *Options) ArchiveReadDays() int {
|
|
|
return o.archiveReadDays
|
|
return o.archiveReadDays
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// RemoveSessionsDays returns the number of days after which to remove sessions.
|
|
|
|
|
+func (o *Options) RemoveSessionsDays() int {
|
|
|
|
|
+ return o.removeSessionsDays
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// PocketConsumerKey returns the Pocket Consumer Key if configured.
|
|
// PocketConsumerKey returns the Pocket Consumer Key if configured.
|
|
|
func (o *Options) PocketConsumerKey(defaultValue string) string {
|
|
func (o *Options) PocketConsumerKey(defaultValue string) string {
|
|
|
if o.pocketConsumerKey != "" {
|
|
if o.pocketConsumerKey != "" {
|