some optimize:

1. not log stacktrace;
2. Remove space when read UUID from file;
3. Config sample file optimize;
pull/103/head
QLeelulu 6 years ago
parent 20dce7d6cf
commit 7a8cb47acb

@ -27,6 +27,7 @@ func main() {
lcf := zap.NewDevelopmentConfig()
lcf.Level.SetLevel(zapcore.Level(*level))
lcf.Development = false
lcf.DisableStacktrace = true
logger, err := lcf.Build(zap.AddCallerSkip(1))
if err != nil {
slog.Fatalln("new log err:", err.Error())

@ -159,7 +159,8 @@ func (c *Conf) UUID() (string, error) {
if len(b) == 0 {
return c.genUUID()
}
return string(b), nil
suid := strings.Join(strings.Fields(string(b)), "")
return suid, nil
}
if !os.IsNotExist(err) {

@ -24,6 +24,6 @@
"Security": "@extend:security.json",
"#comment": "PIDFile and UUIDFile just work for cronnode",
"#PIDFile": "Given a none-empty string to write a pid file to the specialed path, or leave it empty to do nothing",
"PIDFile": "/tmp/cronsun/cronnode_pid",
"PIDFile": "/var/run/cronsun/cronnode.pid",
"UUIDFile": "/etc/cronsun/CRONSUN_UUID"
}

@ -3,6 +3,8 @@
"127.0.0.1:27017"
],
"Database": "cronsun",
"UserName": "",
"Password": "",
"#Timeout": "connect timeout duration/second",
"Timeout": 15
}

@ -1,11 +1,12 @@
{
"BindAddr": ":7079",
"Auth": {
"#Enabled": "set to true to open auth. default username and password is admin@admin.com/admin",
"Enabled": false
},
"Session": {
"StorePrefixPath": "/cronsun/sess/",
"CookieName": "uid",
"CookieName": "cronsun_uid",
"Expiration": 8640000
},
"#comment": "Delete the expired log (which store in mongodb) periodically",

Loading…
Cancel
Save