Browse Source

[Dovecot] Fix check to determine running imapsync procs, todo: more jobs at the same time

andryyy 5 years ago
parent
commit
701198b8f4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      data/Dockerfiles/dovecot/imapsync_cron.pl

+ 2 - 2
data/Dockerfiles/dovecot/imapsync_cron.pl

@@ -11,8 +11,8 @@ use sigtrap 'handler' => \&sig_handler, qw(INT TERM KILL QUIT);
 
 sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
 my $t = Proc::ProcessTable->new;
-my $imapsync_running = grep { $_->{cmndline} =~ /^\/usr\/bin\/perl \/usr\/local\/bin\/imapsync\s/ } @{$t->table};
-if ($imapsync_running eq 1)
+my $imapsync_running = grep { $_->{cmndline} =~ /imapsync\s/i } @{$t->table};
+if ($imapsync_running gt 1)
 {
   print "imapsync is active, exiting...";
   exit;