Commit 92fcf726 authored by IKEDA Soji's avatar 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
......@@ -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' ~%]
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment