优化流程

This commit is contained in:
hoteas 2019-11-10 18:10:26 +08:00
parent 048c457303
commit 9070bd2fe7
2 changed files with 15 additions and 11 deletions

21
.idea/workspace.xml generated
View File

@ -1,12 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b2aca021-ff30-4cbf-8dc9-8cdd4f4c39dc" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application.go" beforeDir="false" afterPath="$PROJECT_DIR$/application.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/cache_db.go" beforeDir="false" afterPath="$PROJECT_DIR$/cache_db.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/db.go" beforeDir="false" afterPath="$PROJECT_DIR$/db.go" afterDir="false" />
</list>
<list default="true" id="b2aca021-ff30-4cbf-8dc9-8cdd4f4c39dc" name="Default Changelist" comment="" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -73,7 +68,7 @@
<option name="presentableId" value="Default" />
<updated>1573372557346</updated>
<workItem from="1573372558521" duration="18000" />
<workItem from="1573372583551" duration="5432000" />
<workItem from="1573372583551" duration="5522000" />
</task>
<task id="LOCAL-00001" summary="清理">
<created>1573372845218</created>
@ -110,7 +105,14 @@
<option name="project" value="LOCAL" />
<updated>1573375887561</updated>
</task>
<option name="localTasksCounter" value="6" />
<task id="LOCAL-00006" summary="数据库缓存">
<created>1573380045254</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1573380045254</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -132,6 +134,7 @@
<component name="VcsManagerConfiguration">
<MESSAGE value="清理" />
<MESSAGE value="自动设置数据库" />
<option name="LAST_COMMIT_MESSAGE" value="自动设置数据库" />
<MESSAGE value="数据库缓存" />
<option name="LAST_COMMIT_MESSAGE" value="数据库缓存" />
</component>
</project>

View File

@ -163,8 +163,9 @@ func (this *Application) SetSession(short CacheIns, Long CacheIns) {
//默认配置缓存和session实现
func (this *Application) SetDefault(connect func(err ...*Error) *sql.DB) {
this.SetConfig()
this.connectDbFunc = connect
if this.connectDbFunc != nil {
if connect != nil {
this.connectDbFunc = connect
this.Db.SetConnect(this.connectDbFunc)
}