This commit is contained in:
astaxie
2013-11-02 00:16:10 +08:00
parent bc862e526d
commit d835b0c80f
5 changed files with 54 additions and 0 deletions

View File

@@ -152,6 +152,17 @@ func (mp *MysqlProvider) SessionGC() {
return
}
func (mp *MysqlProvider) SessionAll() int {
c := mp.connectInit()
defer c.Close()
var total int
err := c.QueryRow("SELECT count(*) as num from session").Scan(&total)
if err != nil {
return 0
}
return total
}
func init() {
Register("mysql", mysqlpder)
}