File tree 2 files changed +21
-7
lines changed
2 files changed +21
-7
lines changed Original file line number Diff line number Diff line change 2
2
3
3
All notable changes to this project will be documented in this file.
4
4
5
+ ### v0.1.4
6
+
7
+ > 23 October 2022
8
+
9
+ - Handle sqlite lock serialization
10
+
5
11
### v0.1.3
6
12
7
13
> 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) {
88
88
for {
89
89
err = saveFileMeta ()
90
90
// 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
+ }
98
106
}
99
107
100
108
if err != nil {
You can’t perform that action at this time.
0 commit comments