From effb65f2d7321d267d444d4231c1aae245e3f619 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 1 Aug 2021 21:42:19 -0700 Subject: changed inactive time limit to 48hrs checks every 24 --- database.go | 2 +- main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/database.go b/database.go index f142ea2..9c68364 100644 --- a/database.go +++ b/database.go @@ -1826,7 +1826,7 @@ func DeleteInstanceFromInactiveDB(db *sql.DB, instance string) { func IsInactiveTimestamp(db *sql.DB, timeStamp string) bool { stamp, _ := time.Parse(time.RFC3339, timeStamp) - if time.Now().Sub(stamp).Hours() > 24 { + if time.Now().UTC().Sub(stamp).Hours() > 48 { return true } diff --git a/main.go b/main.go index 07d2adf..dd9b9d0 100644 --- a/main.go +++ b/main.go @@ -2946,7 +2946,7 @@ func StartupArchive(db *sql.DB) { func CheckInactive(db *sql.DB) { for true { CheckInactiveInstances(db) - time.Sleep(48 * time.Hour) + time.Sleep(24 * time.Hour) } } @@ -2976,9 +2976,10 @@ func CheckInactiveInstances(db *sql.DB) map[string]string { instances[instance] = instance } + re := regexp.MustCompile(Domain + `(.+)?`) for _, e := range instances { actor := GetActor(e) - if actor.Id == "" { + if actor.Id == "" && !re.MatchString(e) { AddInstanceToInactiveDB(db, e) } else { DeleteInstanceFromInactiveDB(db, e) -- cgit v1.2.3