-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Move restore repo to internal router and invoke from command to avoid open the same db file or queues files #15790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## main #15790 +/- ##
==========================================
+ Coverage 43.97% 44.00% +0.03%
==========================================
Files 678 681 +3
Lines 82047 82092 +45
==========================================
+ Hits 36079 36126 +47
+ Misses 40091 40087 -4
- Partials 5877 5879 +2
Continue to review full report at Codecov.
|
c410b8d
to
4bbf276
Compare
OK one final context question. Do we want these to be cancellable by cancelling the request or do we want them to just start the restoration in the background? At the request looks to the user that the wait they're experiencing would imply that it is cancellable but it's not - and in fact the request will timeout after 60s because of the settings in modules/private - That will then look like it has failed but it will continue to do the migration in the background. We could tie the migration to the |
OK. I think we can run it in another goroute and return immediately. |
4bbf276
to
26078d0
Compare
I have set the timeout as zero so that it will not timeout. |
Ok so with the timeout at 0, we're now giving the impression that the request is cancellable and now we should use the myCtx.Req.Context() instead of the hammer context |
26078d0
to
aa24186
Compare
We'll need to add some status updates in future but this is better. |
… open the same db file or queues files (go-gitea#15790) * Move restore repo to internal router and invoke from command to avoid open the same db file or queues files * Follow @zeripath's review * set no timeout for resotre repo private request * make restore repo cancelable
… open the same db file or queues files (go-gitea#15790) * Move restore repo to internal router and invoke from command to avoid open the same db file or queues files * Follow @zeripath's review * set no timeout for resotre repo private request * make restore repo cancelable
When execute the restore repo command and gitea is running, you may got errors to open queue files or sqlite database because the files have been locked.
This PR moves repo restore main logic to internal routers and send a http request to execute the command.
This also fixes the bug that
units
has been ignored from restore repository.