Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
gridtk
Commits
0b6b619a
Commit
0b6b619a
authored
Mar 03, 2016
by
Amir Mohammadi
Browse files
fixes
#4
parent
69f26cf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
gridtk/manager.py
View file @
0b6b619a
...
...
@@ -9,9 +9,8 @@ from .tools import logger
import
sqlalchemy
from
distutils.version
import
LooseVersion
"""This file defines a minimum Job Manager interface."""
sqlalchemy_version
=
[
int
(
v
)
for
v
in
sqlalchemy
.
__version__
.
split
(
'.'
)]
class
JobManager
:
"""This job manager defines the basic interface for handling jobs in the SQL database."""
...
...
@@ -52,7 +51,7 @@ class JobManager:
if
hasattr
(
self
,
'session'
):
raise
RuntimeError
(
'Dead lock detected. Please do not try to lock the session when it is already locked!'
)
if
sqlalchemy_version
<
[
0
,
7
,
8
]
:
if
LooseVersion
(
sqlalchemy
.
_
_version
__
)
<
LooseVersion
(
'0.7.8'
)
:
# for old sqlalchemy versions, in some cases it is required to re-generate the engine for each session
self
.
_engine
=
sqlalchemy
.
create_engine
(
"sqlite:///"
+
self
.
_database
)
self
.
_session_maker
=
sqlalchemy
.
orm
.
sessionmaker
(
bind
=
self
.
_engine
)
...
...
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