Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eta
gajim
Commits
f694ff70
Commit
f694ff70
authored
19 years ago
by
nkour
Browse files
Options
Downloads
Patches
Plain Diff
try to fix a db locked that sometimes happens
parent
3cbf89b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/logger.py
+3
-3
3 additions, 3 deletions
src/common/logger.py
with
3 additions
and
3 deletions
src/common/logger.py
+
3
−
3
View file @
f694ff70
...
...
@@ -76,6 +76,8 @@ constants = Constants()
class
Logger
:
def
__init__
(
self
):
self
.
jids_already_in
=
[]
# holds jids that we already have in DB
if
not
os
.
path
.
exists
(
LOG_DB_PATH
):
# this can happen only the first time (the time we create the db)
# db is not created here but in src/common/checks_paths.py
...
...
@@ -93,7 +95,6 @@ class Logger:
def
get_jids_already_in_db
(
self
):
cur
.
execute
(
'
SELECT jid FROM jids
'
)
rows
=
cur
.
fetchall
()
# list of tupples: (u'aaa@bbb',), (u'cc@dd',)]
self
.
jids_already_in
=
[]
for
row
in
rows
:
# row[0] is first item of row (the only result here, the jid)
self
.
jids_already_in
.
append
(
row
[
0
])
...
...
@@ -201,12 +202,11 @@ class Logger:
jids.jid text column will hold JID if TC-related, room_jid if GC-related,
ROOM_JID/nick if pm-related.
'''
if
not
hasattr
(
self
,
'
get_jids_already_in_db
'
):
if
self
.
jids_already_in
==
[]:
# only happens if we just created the db
global
con
,
cur
con
=
sqlite
.
connect
(
LOG_DB_PATH
,
timeout
=
20.0
,
isolation_level
=
'
IMMEDIATE
'
)
cur
=
con
.
cursor
()
self
.
get_jids_already_in_db
()
jid
=
jid
.
lower
()
contact_name_col
=
None
# holds nickname for kinds gcstatus, gc_msg
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment