File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file.
44
5+ ### v0.1.4
6+
7+ > 23 October 2022
8+
9+ - Handle sqlite lock serialization
10+
511### v0.1.3
612
713> 23 October 2022
Original file line number Diff line number Diff line change @@ -88,13 +88,21 @@ func Upload(repo repository.Repository) func(c *gin.Context) {
8888 for {
8989 err = saveFileMeta ()
9090 // TODO: Need better recognition for handling serialize transaction error
91- serializeErrStr := "ERROR: could not serialize access due to concurrent update (SQLSTATE 40001)"
92- if err != nil && err .Error () != serializeErrStr {
93- c .AbortWithStatusJSON (http .StatusInternalServerError , gin.H {
94- "success" : false ,
95- "message" : "Unable to process the file:" + err .Error (),
96- })
97- return
91+ serializeErrMsgs := []string {
92+ "ERROR: could not serialize access due to concurrent update (SQLSTATE 40001)" ,
93+ "database is locked (5) (SQLITE_BUSY)" ,
94+ }
95+
96+ if err != nil {
97+ for _ , msg := range serializeErrMsgs {
98+ if err .Error () != msg {
99+ c .AbortWithStatusJSON (http .StatusInternalServerError , gin.H {
100+ "success" : false ,
101+ "message" : "Unable to process the file:" + err .Error (),
102+ })
103+ return
104+ }
105+ }
98106 }
99107
100108 if err != nil {
You can’t perform that action at this time.
0 commit comments