Skip to content

Commit 6fd6bc6

Browse files
committed
Fixes #105
1 parent 56238b0 commit 6fd6bc6

File tree

7 files changed

+656
-656
lines changed

7 files changed

+656
-656
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The mission is to bring software dev inspired features (refactoring, testing, li
88

99
## Latest version
1010

11-
v1.50.0
11+
v1.50.1
1212

1313
## OS Support
1414

core/database/check.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var dbPtr *sqlx.DB
3636

3737
// Check that the database is configured correctly and that all the required tables exist.
3838
// It must be the first function called in this package.
39-
func Check(runtime env.Runtime) bool {
39+
func Check(runtime *env.Runtime) bool {
4040
dbPtr = runtime.Db
4141

4242
log.Info("Database checks: started")

edition/boot/runtime.go

+30-30
Original file line numberDiff line numberDiff line change
@@ -26,36 +26,6 @@ import (
2626

2727
// InitRuntime prepares runtime using command line and environment variables.
2828
func InitRuntime(r *env.Runtime) bool {
29-
// Prepare DB
30-
db, err := sqlx.Open("mysql", stdConn(r.Flags.DBConn))
31-
if err != nil {
32-
r.Log.Error("unable to setup database", err)
33-
}
34-
35-
r.Db = db
36-
r.Db.SetMaxIdleConns(30)
37-
r.Db.SetMaxOpenConns(100)
38-
r.Db.SetConnMaxLifetime(time.Second * 14400)
39-
40-
err = r.Db.Ping()
41-
if err != nil {
42-
r.Log.Error("unable to connect to database, connection string should be of the form: '"+
43-
"username:password@tcp(host:3306)/database'", err)
44-
return false
45-
}
46-
47-
// go into setup mode if required
48-
if r.Flags.SiteMode != web.SiteModeOffline {
49-
if database.Check(*r) {
50-
if err := database.Migrate(true /* the config table exists */); err != nil {
51-
r.Log.Error("unable to run database migration", err)
52-
return false
53-
}
54-
} else {
55-
r.Log.Info("going into setup mode to prepare new database")
56-
}
57-
}
58-
5929
// Prepare SALT
6030
if r.Flags.Salt == "" {
6131
b := make([]byte, 17)
@@ -90,6 +60,36 @@ func InitRuntime(r *env.Runtime) bool {
9060
}
9161
}
9262

63+
// Prepare DB
64+
db, err := sqlx.Open("mysql", stdConn(r.Flags.DBConn))
65+
if err != nil {
66+
r.Log.Error("unable to setup database", err)
67+
}
68+
69+
r.Db = db
70+
r.Db.SetMaxIdleConns(30)
71+
r.Db.SetMaxOpenConns(100)
72+
r.Db.SetConnMaxLifetime(time.Second * 14400)
73+
74+
err = r.Db.Ping()
75+
if err != nil {
76+
r.Log.Error("unable to connect to database, connection string should be of the form: '"+
77+
"username:password@tcp(host:3306)/database'", err)
78+
return false
79+
}
80+
81+
// go into setup mode if required
82+
if r.Flags.SiteMode != web.SiteModeOffline {
83+
if database.Check(r) {
84+
if err := database.Migrate(true /* the config table exists */); err != nil {
85+
r.Log.Error("unable to run database migration", err)
86+
return false
87+
}
88+
} else {
89+
r.Log.Info("going into setup mode to prepare new database")
90+
}
91+
}
92+
9393
return true
9494
}
9595

edition/community.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func init() {
3737
runtime.Product = env.ProdInfo{}
3838
runtime.Product.Major = "1"
3939
runtime.Product.Minor = "50"
40-
runtime.Product.Patch = "0"
40+
runtime.Product.Patch = "1"
4141
runtime.Product.Version = fmt.Sprintf("%s.%s.%s", runtime.Product.Major, runtime.Product.Minor, runtime.Product.Patch)
4242
runtime.Product.Edition = "Community"
4343
runtime.Product.Title = fmt.Sprintf("%s Edition", runtime.Product.Edition)

embed/bindata_assetfs.go

+618-618
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "documize",
3-
"version": "1.50.0",
3+
"version": "1.50.1",
44
"description": "The Document IDE",
55
"private": true,
66
"repository": "",

meta.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"community":
33
{
4-
"version": "1.50.0",
4+
"version": "1.50.1",
55
"major": 1,
66
"minor": 50,
7-
"patch": 0
7+
"patch": 1
88
},
99
"enterprise":
1010
{
11-
"version": "1.52.0",
11+
"version": "1.52.1",
1212
"major": 1,
1313
"minor": 52,
14-
"patch": 0
14+
"patch": 1
1515
}
1616
}

0 commit comments

Comments
 (0)