Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to disable executing Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers #396

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions Kernel/System/Web/InterfaceAgent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -378,22 +378,27 @@ sub Run {
return;
}

# execution in 20 seconds
my $ExecutionTimeObj = $DateTimeObj->Clone();
$ExecutionTimeObj->Add( Seconds => 20 );
my $ExecutionTime = $ExecutionTimeObj->ToString();

# add a asychronous executor scheduler task to count the concurrent user
$Kernel::OM->Get('Kernel::System::Scheduler')->TaskAdd(
ExecutionTime => $ExecutionTime,
Type => 'AsynchronousExecutor',
Name => 'PluginAsynchronous::ConcurrentUser',
MaximumParallelInstances => 1,
Data => {
Object => 'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers',
Function => 'RunAsynchronous',
},
);
# Add a asynchronous executor scheduler task to count the concurrent user if enabled.
my $PluginDisabled = $Kernel::OM->Get('Kernel::Config')->Get('SupportDataCollector::DisablePlugins') || [];
my %LookupPluginDisabled = map { $_ => 1 } @{$PluginDisabled};
if ( !$LookupPluginDisabled{'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers'} )
{

# execution in 20 seconds
my $ExecutionTimeObj = $Kernel::OM->Create('Kernel::System::DateTime');
$ExecutionTimeObj->Add( Seconds => 20 );

$Kernel::OM->Get('Kernel::System::Scheduler')->TaskAdd(
ExecutionTime => $ExecutionTimeObj->ToString(),
Type => 'AsynchronousExecutor',
Name => 'PluginAsynchronous::ConcurrentUser',
MaximumParallelInstances => 1,
Data => {
Object => 'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers',
Function => 'RunAsynchronous',
},
);
}

my $UserTimeZone = $Self->_UserTimeZoneGet(%UserData);

Expand Down
36 changes: 21 additions & 15 deletions Kernel/System/Web/InterfaceCustomer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -381,21 +381,27 @@ sub Run {
return;
}

# execution in 20 seconds
my $ExecutionTimeObj = $Kernel::OM->Create('Kernel::System::DateTime');
$ExecutionTimeObj->Add( Seconds => 20 );

# add a asynchronous executor scheduler task to count the concurrent user
$Kernel::OM->Get('Kernel::System::Scheduler')->TaskAdd(
ExecutionTime => $ExecutionTimeObj->ToString(),
Type => 'AsynchronousExecutor',
Name => 'PluginAsynchronous::ConcurrentUser',
MaximumParallelInstances => 1,
Data => {
Object => 'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers',
Function => 'RunAsynchronous',
},
);
# Add a asynchronous executor scheduler task to count the concurrent user if enabled.
my $PluginDisabled = $Kernel::OM->Get('Kernel::Config')->Get('SupportDataCollector::DisablePlugins') || [];
my %LookupPluginDisabled = map { $_ => 1 } @{$PluginDisabled};
if ( !$LookupPluginDisabled{'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers'} )
{

# execution in 20 seconds
my $ExecutionTimeObj = $Kernel::OM->Create('Kernel::System::DateTime');
$ExecutionTimeObj->Add( Seconds => 20 );

$Kernel::OM->Get('Kernel::System::Scheduler')->TaskAdd(
ExecutionTime => $ExecutionTimeObj->ToString(),
Type => 'AsynchronousExecutor',
Name => 'PluginAsynchronous::ConcurrentUser',
MaximumParallelInstances => 1,
Data => {
Object => 'Kernel::System::SupportDataCollector::PluginAsynchronous::OTRS::ConcurrentUsers',
Function => 'RunAsynchronous',
},
);
}

my $UserTimeZone = $Self->_UserTimeZoneGet(%UserData);

Expand Down