From bd23ef0959496aba4c6fc8ca2b3969bbf17aa9d5 Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Mon, 20 May 2019 23:01:13 -0400 Subject: added cache update / db push intervals to conf; made confObj concurrency-safe via sync.RWMutex; new config values related to db/cache --- types.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'types.go') diff --git a/types.go b/types.go index 018e26e..1aaf7a8 100644 --- a/types.go +++ b/types.go @@ -1,6 +1,9 @@ package main -import "sync" +import ( + "sync" + "time" +) // content-type consts const txtutf8 = "text/plain; charset=utf-8" @@ -9,10 +12,16 @@ const cssutf8 = "text/css; charset=utf-8" // config object definition type configuration struct { + mu sync.RWMutex port int - logfile string + logFile string + dbPath string stdoutLogging bool version string + cacheInterval time.Duration + dbInterval time.Duration + lastCache time.Time + lastPush time.Time Instance } -- cgit 1.4.1-2-gfad0