Skip to content

Commit

Permalink
Again enable workaround for utf-8 mysql minion backend bug
Browse files Browse the repository at this point in the history
  • Loading branch information
uralm1 committed Jan 27, 2022
1 parent a5c2ea6 commit 3637d5f
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 12 deletions.
3 changes: 2 additions & 1 deletion lib/Adup/Task/Merge.pm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ sub _merge {
my $percent = ceil($changes_count / $changes_total * 100);
$job->note(
progress => $percent,
info => "$percent% Выполняется изменение-$seq_el->{desc}",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Выполняется изменение-$seq_el->{desc}"),
);
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/Adup/Task/Preprocess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ sub _process_dbf {
my $percent = ceil($_ / $last_record * 100);
$job->note(
progress => $percent,
info => "$percent% Обработка перечня сотрудников",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Обработка перечня сотрудников"),
);
}
}
Expand Down Expand Up @@ -172,7 +173,8 @@ sub _process_dbf {

$job->note(
progress => 100,
info => 'Выполняется разбор оргструктуры подразделений',
# mysql minion backend bug workaround
info => encode_utf8('Выполняется разбор оргструктуры подразделений'),
);

#
Expand Down
4 changes: 3 additions & 1 deletion lib/Adup/Task/Zupprocess.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use Mojo::Base 'Mojolicious::Plugin';

use Carp;
use POSIX qw(ceil);
use Encode qw(encode_utf8);
#use Data::Dumper;

use Adup::Ural::Dblog;
Expand Down Expand Up @@ -37,7 +38,8 @@ sub _load_zup {

my $loader = eval {
Adup::Ural::ZupLoader->new($app, $db_adup,
sub { $job->note(progress => shift, info => shift) }
# mysql minion backend bug workaround
sub { $job->note(progress => shift, info => encode_utf8(shift)) }
)
};
if ($@) {
Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncAttributesCreateMoveUsers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ sub do_sync {
my $percent = ceil(($args{pos} + $line_count / $lines_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Синхронизация пользователей, изменений аттрибутов",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Синхронизация пользователей, изменений аттрибутов"),
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncCreateFlatGroups.pm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ sub do_sync {
my $percent = ceil(($args{pos} + $line_count / $lines_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Синхронизация групп почтового справочника",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Синхронизация групп почтового справочника"),
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncCreateOUs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ sub do_sync {
my $percent = ceil(($args{pos} + $line_count / $lines_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Синхронизация подразделений",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Синхронизация подразделений"),
);
}
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncDeleteFlatGroups.pm
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ sub do_sync {
my $percent = ceil(($args{pos} + $entry_count / $entries_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Завершающая синхронизация групп почтового справочника",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Завершающая синхронизация групп почтового справочника"),
);
}
} # entries loop
Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncDeleteOUs.pm
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ ENTRYLOOP:
my $percent = ceil(($args{pos} + $entry_count / $entries_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Завершающая синхронизация подразделений",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Завершающая синхронизация подразделений"),
);
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Adup/Ural/SyncDeleteUsers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ sub do_sync {
my $percent = ceil(($args{pos} + $entry_count / $entries_total) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% Завершающая синхронизация уволенных пользователей",
# mysql minion backend bug workaround
info => encode_utf8("$percent% Завершающая синхронизация уволенных пользователей"),
);
}
}
Expand Down
6 changes: 4 additions & 2 deletions lib/Adup/Ural/SyncDisableDismissed.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ sub do_sync {
my $percent = ceil($args{pos} * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% $pmsg",
# mysql minion backend bug workaround
info => encode_utf8("$percent% $pmsg"),
);

#
Expand Down Expand Up @@ -98,7 +99,8 @@ sub do_sync {
$percent = int(($args{pos} + 1) * $args{job}->app->percent_sync_task);
$args{job}->note(
progress => $percent,
info => "$percent% $pmsg",
# mysql minion backend bug workaround
info => encode_utf8("$percent% $pmsg"),
);

$args{log}->l(info => "Проверка блокирования архивных учётных записей. Создано $delete_changes_count изменений блокирования архивных учётных записей.");
Expand Down

0 comments on commit 3637d5f

Please sign in to comment.