Commit 9a799621 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

Small fix: Duplicate counts of update.

parent bf7661f2
......@@ -73,6 +73,7 @@ sub _get_data_sources {
} @config;
}
} elsif ($role eq 'member') {
#FIXME: Use Sympa::Config.
my @config_files = map { $list->_load_include_admin_user_file($_) }
@{$list->{'admin'}{'member_include'} || []};
......@@ -92,6 +93,7 @@ sub _get_data_sources {
}
} else {
my $pname = ($role eq 'owner') ? 'owner_include' : 'editor_include';
#FIXME: Use Sympa::Config.
my @config_files = map { $list->_load_include_admin_user_file($_) }
@{$list->{'admin'}{$pname} || []};
......@@ -363,6 +365,17 @@ sub __update_user {
# 3. If user (has not been updated by the other data sources and) exists:
# UPDATE inclusion.
if ($is_external_ds) {
return unless $sth = $sdm->do_prepared_query(
qq{UPDATE ${t}_table
SET inclusion_$t = ?, inclusion_ext_$t = ?
WHERE user_$t = ? AND list_$t = ? AND robot_$t = ?$r AND
inclusion_$t IS NOT NULL AND ? <= inclusion_$t},
$time, $time,
$email, $list->{'name'}, $list->{'domain'},
$start_time
);
return (updated => 0) if $sth->rows;
return unless $sth = $sdm->do_prepared_query(
qq{UPDATE ${t}_table
SET inclusion_$t = ?, inclusion_ext_$t = ?
......@@ -370,6 +383,7 @@ sub __update_user {
$time, $time,
$email, $list->{'name'}, $list->{'domain'}
);
return (updated => 1) if $sth->rows;
} else {
return unless $sth = $sdm->do_prepared_query(
qq{UPDATE ${t}_table
......@@ -378,8 +392,8 @@ sub __update_user {
$time,
$email, $list->{'name'}, $list->{'domain'}
);
return (updated => 1) if $sth->rows;
}
return (updated => 1) if $sth->rows; #FIXME: Duplicate counts
# 4. Otherwise, i.e. a new user:
# INSERT new user with:
......
Supports Markdown
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