Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
5ec1283b
Commit
5ec1283b
authored
Aug 25, 2020
by
blitzmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove threading for the calibre DB class
parent
8634b0c6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 addition
and
8 deletions
+1
-8
__init__.py
cps/__init__.py
+0
-1
db.py
cps/db.py
+1
-4
server.py
cps/server.py
+0
-3
No files found.
cps/__init__.py
View file @
5ec1283b
...
...
@@ -102,7 +102,6 @@ def create_app():
web_server
.
init_app
(
app
,
config
)
calibre_db
.
setup_db
(
config
,
cli
.
settingspath
)
calibre_db
.
start
()
babel
.
init_app
(
app
)
_BABEL_TRANSLATIONS
.
update
(
str
(
item
)
for
item
in
babel
.
list_translations
())
...
...
cps/db.py
View file @
5ec1283b
...
...
@@ -24,14 +24,12 @@ import re
import
ast
import
json
from
datetime
import
datetime
import
threading
from
sqlalchemy
import
create_engine
from
sqlalchemy
import
Table
,
Column
,
ForeignKey
,
CheckConstraint
from
sqlalchemy
import
String
,
Integer
,
Boolean
,
TIMESTAMP
,
Float
from
sqlalchemy.orm
import
relationship
,
sessionmaker
,
scoped_session
from
sqlalchemy.ext.declarative
import
declarative_base
from
sqlalchemy.exc
import
OperationalError
from
sqlalchemy.pool
import
StaticPool
from
flask_login
import
current_user
from
sqlalchemy.sql.expression
import
and_
,
true
,
false
,
text
,
func
,
or_
...
...
@@ -332,10 +330,9 @@ class Custom_Columns(Base):
return
display_dict
class
CalibreDB
(
threading
.
Thread
):
class
CalibreDB
():
def
__init__
(
self
):
threading
.
Thread
.
__init__
(
self
)
self
.
engine
=
None
self
.
session
=
None
self
.
log
=
None
...
...
cps/server.py
View file @
5ec1283b
...
...
@@ -200,9 +200,6 @@ class WebServer(object):
def
stop
(
self
,
restart
=
False
):
from
.
import
updater_thread
updater_thread
.
stop
()
from
.
import
calibre_db
calibre_db
.
stop
()
log
.
info
(
"webserver stop (restart=
%
s)"
,
restart
)
self
.
restart
=
restart
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment