Explorar el Código

导入sql事务

yxh hace 4 años
padre
commit
2eeb3964a6
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      app/system/service/tools_gen_table.go

+ 3 - 0
app/system/service/tools_gen_table.go

@@ -648,6 +648,9 @@ func (s *toolsGenTable) writeDb(path string, ctx context.Context) (err error) {
 	var id int64
 	var id int64
 	var tx *gdb.TX
 	var tx *gdb.TX
 	tx, err = g.DB().Ctx(ctx).Begin()
 	tx, err = g.DB().Ctx(ctx).Begin()
+	if err != nil {
+		return
+	}
 	for {
 	for {
 		bytes, e := br.ReadBytes('\n')
 		bytes, e := br.ReadBytes('\n')
 		if e == io.EOF {
 		if e == io.EOF {