We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95f828d commit 7ef1a0eCopy full SHA for 7ef1a0e
cache/cache.go
@@ -41,6 +41,10 @@ func Init(cachePath string, logLevel int) error {
41
}
42
43
func Close() {
44
+ // clear banned sa's
45
+ ClearExpiredBans()
46
+
47
+ // close
48
if err := db.Close(); err != nil {
49
log.WithError(err).Error("Failed closing cache gracefully...")
50
cache/sa.go
@@ -10,6 +10,16 @@ type Banned struct {
10
Expires time.Time
11
12
13
+func ClearExpiredBans() {
14
+ iter := db.Bucket("banned").Iter()
15
+ defer iter.Close()
16
17
+ var page Banned
18
+ for iter.Next(&page) {
19
+ _, _ = IsBanned(page.Path)
20
+ }
21
+}
22
23
func IsBanned(key string) (bool, time.Time) {
24
// check if key was found in banned bucket
25
var item Banned
0 commit comments