feat(client/worker): support web work in frontend with fallback (#31)
* feat(client/web): add upload mgr * feat(uploader): move uploader to worker * feat(upload_mgr): use native worker for uploading * fix(upload_mgr): fix uploading stop not working * chore(client/web): cleanups * test(upload.worker): add unit test for upload.worker * feat(worker): add foreground upload worker * chore(uploader): turn down the speedup
This commit is contained in:
parent
67c07cc81f
commit
31e4850344
27 changed files with 1192 additions and 265 deletions
|
@ -118,7 +118,11 @@ func (h *FileHandlers) Create(c *gin.Context) {
|
|||
locker.Exec(func() {
|
||||
err := h.deps.FS().Create(tmpFilePath)
|
||||
if err != nil {
|
||||
c.JSON(q.ErrResp(c, 500, err))
|
||||
if os.IsExist(err) {
|
||||
c.JSON(q.ErrResp(c, 304, err))
|
||||
} else {
|
||||
c.JSON(q.ErrResp(c, 500, err))
|
||||
}
|
||||
return
|
||||
}
|
||||
err = h.uploadMgr.AddInfo(userName, req.Path, tmpFilePath, req.FileSize)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue