Mercurial > gemma
comparison pkg/misc/tmpfiles.go @ 5490:5f47eeea988d logging
Use own logging package.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 20 Sep 2021 17:45:39 +0200 |
parents | 5b9b8eabcd01 |
children |
comparison
equal
deleted
inserted
replaced
5488:a726a92ea5c9 | 5490:5f47eeea988d |
---|---|
13 | 13 |
14 package misc | 14 package misc |
15 | 15 |
16 import ( | 16 import ( |
17 "encoding/hex" | 17 "encoding/hex" |
18 "log" | |
19 "os" | 18 "os" |
20 "path/filepath" | 19 "path/filepath" |
21 "sort" | 20 "sort" |
22 "sync" | 21 "sync" |
23 "time" | 22 "time" |
24 | 23 |
25 "gemma.intevation.de/gemma/pkg/common" | 24 "gemma.intevation.de/gemma/pkg/common" |
26 "gemma.intevation.de/gemma/pkg/config" | 25 "gemma.intevation.de/gemma/pkg/config" |
26 "gemma.intevation.de/gemma/pkg/log" | |
27 ) | 27 ) |
28 | 28 |
29 const ( | 29 const ( |
30 tmpFilesDir = "tmpfiles" | 30 tmpFilesDir = "tmpfiles" |
31 maxTmpFiles = 100 | 31 maxTmpFiles = 100 |
38 func init() { | 38 func init() { |
39 go func() { | 39 go func() { |
40 config.WaitReady() | 40 config.WaitReady() |
41 for { | 41 for { |
42 if err := cleanupTmpFiles(); err != nil { | 42 if err := cleanupTmpFiles(); err != nil { |
43 log.Printf("error: %v\n", err) | 43 log.Errorf("%v\n", err) |
44 } | 44 } |
45 time.Sleep(tmpfilesCleanUp) | 45 time.Sleep(tmpfilesCleanUp) |
46 } | 46 } |
47 }() | 47 }() |
48 } | 48 } |