#2878 print error of JSON unmarshal and always returns a valid object
parent
dd36c431ec
commit
ac53bb593d
|
@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
|
||||||
|
|
||||||
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
|
||||||
|
|
||||||
##### Current version: 0.9.16
|
##### Current version: 0.9.17
|
||||||
|
|
||||||
| Web | UI | Preview |
|
| Web | UI | Preview |
|
||||||
|:-------------:|:-------:|:-------:|
|
|:-------------:|:-------:|:-------:|
|
||||||
|
|
|
@ -43,9 +43,11 @@ If you're more comfortable with mounting data to a data container, the commands
|
||||||
```
|
```
|
||||||
# Create data container
|
# Create data container
|
||||||
docker run --name=gogs-data --entrypoint /bin/true gogs/gogs
|
docker run --name=gogs-data --entrypoint /bin/true gogs/gogs
|
||||||
|
|
||||||
# Use `docker run` for the first time.
|
# Use `docker run` for the first time.
|
||||||
docker run --name=gogs --volumes-from gogs-data -p 10022:22 -p 10080:3000 gogs/gogs
|
docker run --name=gogs --volumes-from gogs-data -p 10022:22 -p 10080:3000 gogs/gogs
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Using Docker 1.9 Volume command
|
#### Using Docker 1.9 Volume command
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
2
gogs.go
2
gogs.go
|
@ -17,7 +17,7 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const APP_VER = "0.9.16.0325"
|
const APP_VER = "0.9.17.0326"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||||
|
|
|
@ -18,6 +18,7 @@ import (
|
||||||
|
|
||||||
"github.com/gogits/gogs/models"
|
"github.com/gogits/gogs/models"
|
||||||
"github.com/gogits/gogs/modules/base"
|
"github.com/gogits/gogs/modules/base"
|
||||||
|
"github.com/gogits/gogs/modules/log"
|
||||||
"github.com/gogits/gogs/modules/markdown"
|
"github.com/gogits/gogs/modules/markdown"
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
@ -255,7 +256,7 @@ func ActionIcon(opType int) string {
|
||||||
func ActionContent2Commits(act Actioner) *models.PushCommits {
|
func ActionContent2Commits(act Actioner) *models.PushCommits {
|
||||||
push := models.NewPushCommits()
|
push := models.NewPushCommits()
|
||||||
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
|
if err := json.Unmarshal([]byte(act.GetContent()), push); err != nil {
|
||||||
return nil
|
log.Error(4, "json.Unmarshal:\n%s\nERROR: %v", act.GetContent(), err)
|
||||||
}
|
}
|
||||||
return push
|
return push
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
0.9.16.0325
|
0.9.17.0326
|
Loading…
Reference in New Issue