add core.HistoryDays for variable history kept
This commit is contained in:
+7
-1
@@ -19,6 +19,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"golang.nytpu.com/comitium/localizations"
|
||||
)
|
||||
@@ -40,11 +41,14 @@ var (
|
||||
// Timeout for requests
|
||||
var Timeout int
|
||||
|
||||
// Number of days of history to keep
|
||||
var HistoryDays time.Time
|
||||
|
||||
var Localizer *localizations.Localizer
|
||||
|
||||
// have to do this instead of the automatically called init() because
|
||||
// initialization stuff requires parsing of command line args first
|
||||
func Init(dataPath string, localizer *localizations.Localizer) error {
|
||||
func Init(dataPath string, localizer *localizations.Localizer, days int) error {
|
||||
Localizer = localizer
|
||||
|
||||
// initialize comitium.json & data maps
|
||||
@@ -98,6 +102,8 @@ func Init(dataPath string, localizer *localizations.Localizer) error {
|
||||
}
|
||||
Footer = fmt.Sprintf("\n\n%s", footer)
|
||||
|
||||
HistoryDays = time.Now().AddDate(0, 0, -days)
|
||||
|
||||
Timeout = 10
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user