Skip to content

Commit

Permalink
Merge pull request #158 from trheyi/main
Browse files Browse the repository at this point in the history
[add] session debug  log
  • Loading branch information
trheyi authored Oct 10, 2023
2 parents 8ef18ac + 3b7edbf commit 1883d72
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions session/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

"github.com/yaoapp/gou/process"
"github.com/yaoapp/kun/log"
)

// SessionHandlers 模型运行器
Expand Down Expand Up @@ -65,14 +66,17 @@ func processSet(process *process.Process) interface{} {
process.ValidateArgNums(2)
ss := setSession(process)
if process.NumOfArgs() == 3 {
log.Debug("set session KEY: %s, VALUE: %v, TS: %d", process.ArgsString(0), process.Args[1], process.ArgsInt(2))
ss.MustSetWithEx(process.ArgsString(0), process.Args[1], time.Duration(process.ArgsInt(2))*time.Second)
return nil

} else if process.NumOfArgs() == 4 {
log.Debug("set session ID: %s KEY: %s, VALUE: %v, TS: %d", process.ArgsString(3), process.ArgsString(0), process.Args[1], process.ArgsInt(2))
ss = Global().ID(process.ArgsString(3))
ss.MustSetWithEx(process.ArgsString(0), process.Args[1], time.Duration(process.ArgsInt(2))*time.Second)
}

log.Debug("set session KEY: %s, VALUE: %v", process.ArgsString(0), process.Args[1])
ss.MustSet(process.ArgsString(0), process.Args[1])
return nil
}
Expand Down

0 comments on commit 1883d72

Please sign in to comment.