Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
slapos.core
Commits
cc82e613
Commit
cc82e613
authored
Jan 29, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos/collect: Set pragma to wal
To allow more concurrent access to the sqlite
parent
84ff7a8c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
slapos/collect/db.py
slapos/collect/db.py
+2
-0
No files found.
slapos/collect/db.py
View file @
cc82e613
...
@@ -38,6 +38,7 @@ class Database:
...
@@ -38,6 +38,7 @@ class Database:
database_name
=
"collector.db"
database_name
=
"collector.db"
preserve_table_list
=
[
"heating"
]
preserve_table_list
=
[
"heating"
]
SET_PRAGMA_MODE
=
"pragma journal_mode=wal"
CREATE_USER_TABLE
=
"create table if not exists user "
\
CREATE_USER_TABLE
=
"create table if not exists user "
\
"(partition text, pid real, process text, "
\
"(partition text, pid real, process text, "
\
" cpu_percent real, cpu_time real, "
\
" cpu_percent real, cpu_time real, "
\
...
@@ -152,6 +153,7 @@ class Database:
...
@@ -152,6 +153,7 @@ class Database:
def
_bootstrap
(
self
):
def
_bootstrap
(
self
):
assert
self
.
CREATE_USER_TABLE
is
not
None
assert
self
.
CREATE_USER_TABLE
is
not
None
self
.
connect
()
self
.
connect
()
self
.
_execute
(
self
.
SET_PRAGMA_MODE
)
self
.
_execute
(
self
.
CREATE_USER_TABLE
)
self
.
_execute
(
self
.
CREATE_USER_TABLE
)
self
.
_execute
(
self
.
CREATE_USER_PARTITION_DATE_TIME_INDEX
)
self
.
_execute
(
self
.
CREATE_USER_PARTITION_DATE_TIME_INDEX
)
self
.
_execute
(
self
.
CREATE_FOLDER_TABLE
)
self
.
_execute
(
self
.
CREATE_FOLDER_TABLE
)
...
...
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