before refactor

This commit is contained in:
DarkGopher 2025-06-23 17:53:41 +02:00
parent fcc5e805ec
commit 994871426d
2 changed files with 1 additions and 12 deletions

View file

@ -6,7 +6,6 @@ import (
"container/list"
"encoding/gob"
"fmt"
"log"
"os"
"path"
"sync"
@ -131,15 +130,6 @@ func (pder *ProviderFiles) Exists(sid string) (ex bool) {
return
}
/*// Exists check if session sid exists in storage
func (pder *ProviderFiles) Exists(sid string) bool {
ckf := ckdirpath(sid)
if _, err := os.Stat(ckf); errors.Is(err, os.ErrExist) {
return false
}
return true
}*/
// GC periodically remove old sessions rom storages
func (pder *ProviderFiles) GC(maxlifetime int64) {
pder.lock.Lock()
@ -156,7 +146,6 @@ func (pder *ProviderFiles) GC(maxlifetime int64) {
continue
}
if at.UnixMilli()+(maxlifetime*int64(session.MilisPerSecDuration())) < time.Now().UnixMilli() {
log.Printf("GC remove session: %s atime: %v now: %v", sid, at, time.Now())
pder.li.Remove(ssel)
delete(pder.sessions, sid)
ckf := ckdirpath(sid)

View file

@ -304,7 +304,7 @@ func TestRunAll(t *testing.T) {
fns := []func(t *testing.T){t1, t2, t3, t4, t5, t6, t7, t8, t9}
for idx, fn := range fns {
t.Run(fmt.Sprintf("Test-%d-prv-%s", idx+1, pn), fn)
t.Run(fmt.Sprintf("Test-%d-store-%s", idx+1, pn), fn)
}
}
}