before refactor
This commit is contained in:
parent
fcc5e805ec
commit
994871426d
2 changed files with 1 additions and 12 deletions
|
@ -6,7 +6,6 @@ import (
|
||||||
"container/list"
|
"container/list"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -131,15 +130,6 @@ func (pder *ProviderFiles) Exists(sid string) (ex bool) {
|
||||||
return
|
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
|
// GC periodically remove old sessions rom storages
|
||||||
func (pder *ProviderFiles) GC(maxlifetime int64) {
|
func (pder *ProviderFiles) GC(maxlifetime int64) {
|
||||||
pder.lock.Lock()
|
pder.lock.Lock()
|
||||||
|
@ -156,7 +146,6 @@ func (pder *ProviderFiles) GC(maxlifetime int64) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if at.UnixMilli()+(maxlifetime*int64(session.MilisPerSecDuration())) < time.Now().UnixMilli() {
|
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)
|
pder.li.Remove(ssel)
|
||||||
delete(pder.sessions, sid)
|
delete(pder.sessions, sid)
|
||||||
ckf := ckdirpath(sid)
|
ckf := ckdirpath(sid)
|
||||||
|
|
|
@ -304,7 +304,7 @@ func TestRunAll(t *testing.T) {
|
||||||
|
|
||||||
fns := []func(t *testing.T){t1, t2, t3, t4, t5, t6, t7, t8, t9}
|
fns := []func(t *testing.T){t1, t2, t3, t4, t5, t6, t7, t8, t9}
|
||||||
for idx, fn := range fns {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue