3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

Command queue no longer delays commands relative to each other

This commit is contained in:
Pragmatic Software 2016-07-01 13:29:26 -07:00
parent b03a4b68e6
commit 949dc14525

View File

@ -394,12 +394,7 @@ sub process_output_queue {
sub add_to_command_queue {
my ($self, $channel, $command, $delay) = @_;
if (exists $self->{command_queue}->{$channel}) {
my $last_when = $self->{command_queue}->{$channel}->[-1]->{when};
$command->{when} = $last_when + $delay;
} else {
$command->{when} = gettimeofday + $delay;
}
$command->{when} = gettimeofday + $delay;
push @{$self->{command_queue}->{$channel}}, $command;
}