Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
92fcf726
Commit
92fcf726
authored
Mar 15, 2020
by
IKEDA Soji
Browse files
sympa.pl --sync_include: No errors weren't reported to caller,
even if one or more of data sources failed inclusion.
parent
3721115e
Changes
2
Hide whitespace changes
Inline
Side-by-side
default/mail_tt2/report.tt2
View file @
92fcf726
...
...
@@ -357,7 +357,37 @@
[%~ ELSIF report_entry == 'no_message_to_moderate' ~%]
[%|loc(report_param.listname)%]There is no message to moderate for list '%1'.[%END%]
[%~ ELSIF report_entry == 'time_limit_for_include' ~%]
[%~ ELSIF report_entry == 'include_skip' ~%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.listname)%]Including list owners into list %2 was skipped.[%END%]
[%~ ELSIF report_param.role == 'editor' ~%]
[%|loc(report_param.listname)%]Including moderators into list %2 was skipped.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.listname)%]Including subscribers into list %2 was skipped.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'include' ~%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.name,report_param.listname)%]List owners were included from data source "%1" into list %2.[%END%]
[%~ ELSIF report_param.role == 'editor' ~%]
[%|loc(report_param.name,report_param.listname)%]Moderators were included from data source "%1" into list %2.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.name,report_param.listname)%]Subscribers were included from data source "%1" into list %2.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'include_failed' ~%]
[% IF report_param.role == 'owner' ~%]
[%|loc(report_param.name,report_param.listname)%]Including list owners from data source "%1" into list %2 failed.[%END%]
[%~ ELSIF report_param.role == 'editor' ~%]
[%|loc(report_param.name,report_param.listname)%]Including moderators from data source "%1" into list %2 failed.[%END%]
[%~ ELSE ~%]
[%|loc(report_param.name,report_param.listname)%]Including subscribers from data source "%1" into list %2 failed.[%END%]
[%~ END %]
[%~ ELSIF report_entry == 'include_performed' ~%]
[%|loc(report_param.result.added,report_param.result.deleted,report_param.result.updated)%]Inclusion succeeded (%1 added, %2 deleted, %3 updated).[%END%]
[%~ ELSIF report_entry == 'time_limit_for_include' # Maybe no longer used ~%]
[%|loc()%]You're not allowed to make sync, time limit in action[%END%]
[%~ ELSIF report_entry == 'del_performed' ~%]
...
...
src/lib/Sympa/Request/Handler/include.pm
View file @
92fcf726
...
...
@@ -141,7 +141,7 @@ sub _twist {
unless
(
$lock_fh
)
{
$log
->
syslog
('
info
',
'
%s: Locked, skip inclusion
',
$list
);
$self
->
add_stash
(
$request
,
'
notice
',
'
include_skip
',
{
listname
=>
$list
->
{'
name
'}});
{
listname
=>
$list
->
{'
name
'}
,
role
=>
$role
});
return
0
;
}
...
...
@@ -162,7 +162,7 @@ sub _twist {
# Avoid retrace of clock e.g. by outage of NTP server.
$log
->
syslog
('
info
',
'
%s: Clock got behind, skip inclusion
',
$list
);
$self
->
add_stash
(
$request
,
'
notice
',
'
include_skip
',
{
listname
=>
$list
->
{'
name
'}});
{
listname
=>
$list
->
{'
name
'}
,
role
=>
$role
});
return
0
;
}
...
...
@@ -182,7 +182,18 @@ sub _twist {
next
unless
$ds
->
is_allowed_to_sync
;
my
%res
=
_update_users
(
$ds
,
$start_time
);
next
unless
%res
;
unless
(
%res
)
{
$self
->
add_stash
(
$request
,
'
notice
',
'
include_failed
',
{
listname
=>
$list
->
{'
name
'},
role
=>
$role
,
id
=>
$ds
->
get_short_id
,
name
=>
$ds
->
name
,
}
);
next
;
}
# Update time of allowed and succeeded data sources.
$start_times
{
$ds
->
get_short_id
}
=
$start_time
;
...
...
@@ -199,6 +210,7 @@ sub _twist {
$request
,
'
notice
',
'
include
',
{
listname
=>
$list
->
{'
name
'},
role
=>
$role
,
id
=>
$ds
->
get_short_id
,
name
=>
$ds
->
name
,
result
=>
{
%res
}
...
...
@@ -280,7 +292,7 @@ sub _twist {
$request
,
@result
{
qw(added deleted updated)
}
);
$self
->
add_stash
(
$request
,
'
notice
',
'
include_performed
',
{
listname
=>
$list
->
{'
name
'},
result
=>
{
%result
}});
{
listname
=>
$list
->
{'
name
'},
role
=>
$role
,
result
=>
{
%result
}});
return
1
;
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment