-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit makes DB upgrader from 72 to 73(Pony) run in foreground (at the "spinning gears" screen). "Skip" button is shown on the screen during the upgrading process. A corresponding dialog window REST endpoint are added, too. To speed up the upgrade process, disk synchronization is disabled. This is safe since we don't touch the original database.
- Loading branch information
Showing
13 changed files
with
315 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
from __future__ import absolute_import | ||
|
||
import logging | ||
|
||
from twisted.web import resource | ||
|
||
import Tribler.Core.Utilities.json_util as json | ||
|
||
|
||
class UpgraderEndpoint(resource.Resource): | ||
""" | ||
With this endpoint you can control DB upgrade process of Tribler. | ||
""" | ||
|
||
def __init__(self, session): | ||
resource.Resource.__init__(self) | ||
self._logger = logging.getLogger(self.__class__.__name__) | ||
self.session = session | ||
|
||
def render_DELETE(self, _): | ||
""" | ||
.. http:put:: /upgrader | ||
A PUT request to this endpoint will skip the DB upgrade process, if it is running. | ||
**Example request**: | ||
.. sourcecode:: none | ||
curl -X DELETE http://localhost:8085/upgrader | ||
**Example response**: | ||
.. sourcecode:: javascript | ||
{ | ||
"skip": True | ||
} | ||
""" | ||
|
||
if self.session.upgrader: | ||
self.session.upgrader.skip() | ||
|
||
return json.twisted_dumps({"skip": True}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.