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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor 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
mesonium
gajim
Commits
af663ca7
Commit
af663ca7
authored
4 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
MAM: Always include JID in logging messages
parent
8744bc0e
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
gajim/common/modules/mam.py
+17
-14
17 additions, 14 deletions
gajim/common/modules/mam.py
with
17 additions
and
14 deletions
gajim/common/modules/mam.py
+
17
−
14
View file @
af663ca7
...
...
@@ -264,7 +264,7 @@ def request_archive_on_signin(self):
own_jid
=
self
.
_con
.
get_own_jid
().
getBare
()
if
own_jid
in
self
.
_mam_query_ids
:
self
.
_log
.
warning
(
'
MAM r
equest
for %s
already running
'
,
own_jid
)
self
.
_log
.
warning
(
'
R
equest already running
: %s
'
,
own_jid
)
return
archive
=
app
.
logger
.
get_archive_infos
(
own_jid
)
...
...
@@ -281,12 +281,14 @@ def request_archive_on_signin(self):
start_date
=
None
queryid
=
self
.
_get_query_id
(
own_jid
)
if
mam_id
:
self
.
_log
.
info
(
'
MAM query after: %s
'
,
mam_id
)
self
.
_log
.
info
(
'
Request archive: %s, after mam-id %s
'
,
own_jid
,
mam_id
)
else
:
# First Start, we request the last week
start_date
=
datetime
.
utcnow
()
-
timedelta
(
days
=
7
)
self
.
_log
.
info
(
'
First start: query archive start: %s
'
,
start_date
)
self
.
_log
.
info
(
'
Request archive: %s, after date %s
'
,
own_jid
,
start_date
)
self
.
_nbxmpp
(
'
MAM
'
).
make_query
(
own_jid
,
queryid
,
...
...
@@ -310,14 +312,14 @@ def request_archive_on_muc_join(self, jid):
if
archive
is
None
or
archive
.
last_mam_id
is
None
:
# First join
start_date
=
datetime
.
utcnow
()
-
timedelta
(
days
=
1
)
self
.
_log
.
info
(
'
First join:
que
ry
archive %s
from:
%s
'
,
self
.
_log
.
info
(
'
Re
que
st
archive
:
%s
, after date
%s
'
,
jid
,
start_date
)
elif
threshold
==
SyncThreshold
.
NO_THRESHOLD
:
# Not our first join and no threshold set
mam_id
=
archive
.
last_mam_id
self
.
_log
.
info
(
'
Request
from
archive: %s, after mam-id %s
'
,
self
.
_log
.
info
(
'
Request archive: %s, after mam-id %s
'
,
jid
,
archive
.
last_mam_id
)
else
:
...
...
@@ -325,7 +327,7 @@ def request_archive_on_muc_join(self, jid):
# last join and check against threshold
last_timestamp
=
archive
.
last_muc_timestamp
if
last_timestamp
is
None
:
self
.
_log
.
info
(
'
No last muc timestamp found
'
)
self
.
_log
.
info
(
'
No last muc timestamp found
: %s
'
,
jid
)
last_timestamp
=
0
last
=
datetime
.
utcfromtimestamp
(
float
(
last_timestamp
))
...
...
@@ -333,13 +335,13 @@ def request_archive_on_muc_join(self, jid):
# To much time has elapsed since last join, apply threshold
start_date
=
datetime
.
utcnow
()
-
timedelta
(
days
=
threshold
)
self
.
_log
.
info
(
'
Too much time elapsed since last join,
'
'
request
from: %s, threshold: %s
'
,
start_date
,
threshold
)
'
request
archive: %s, after date %s,
'
'
threshold: %s
'
,
jid
,
start_date
,
threshold
)
else
:
# Request from last mam-id
mam_id
=
archive
.
last_mam_id
self
.
_log
.
info
(
'
Request
from
archive %s after %s:
'
,
self
.
_log
.
info
(
'
Request archive
:
%s
,
after
mam-id
%s:
'
,
jid
,
archive
.
last_mam_id
)
if
jid
in
self
.
_catch_up_finished
:
...
...
@@ -370,7 +372,7 @@ def _result_finished(self, result, user_data):
if
result
.
complete
:
self
.
_catch_up_finished
.
append
(
result
.
jid
)
self
.
_log
.
info
(
'
Catchup
finished: %s, last mam id: %s
'
,
self
.
_log
.
info
(
'
Request
finished: %s, last mam id: %s
'
,
result
.
jid
,
result
.
rsm
.
last
)
if
result
.
rsm
.
last
is
not
None
:
...
...
@@ -408,13 +410,14 @@ def request_archive_interval(self,
after
=
None
,
queryid
=
None
):
jid
=
self
.
_con
.
get_own_jid
().
getBare
()
if
after
is
None
:
self
.
_log
.
info
(
'
Request interval from %s to %s
'
,
start_date
,
end_date
)
self
.
_log
.
info
(
'
Request interval
: %s,
from %s to %s
'
,
jid
,
start_date
,
end_date
)
else
:
self
.
_log
.
info
(
'
Query page
after %s
'
,
after
)
self
.
_log
.
info
(
'
Request page: %s,
after %s
'
,
jid
,
after
)
jid
=
self
.
_con
.
get_own_jid
().
getBare
()
if
queryid
is
None
:
queryid
=
self
.
_get_query_id
(
jid
)
self
.
_mam_query_ids
[
jid
]
=
queryid
...
...
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