Skip to content

Ursa 21.14.0 plat 25213 #13265

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

Open
wants to merge 3 commits into
base: Venus-22.0.0
Choose a base branch
from
Open

Conversation

danbar0kal
Copy link
Collaborator

No description provided.

@danbar0kal danbar0kal changed the base branch from Ursa-21.15.0 to Ursa-21.16.0 May 12, 2025 12:20
@danbar0kal danbar0kal changed the base branch from Ursa-21.16.0 to Ursa-21.17.0 May 26, 2025 09:36
@danbar0kal danbar0kal requested a review from Copilot June 10, 2025 07:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new scheduling function in the scheduled task runner to index tasks per partner and adds a safety check in the generic scheduler to ensure indexes are iterated only when in array format.

  • Added getMrIndexPerPartner() to compute a task index based on partnerId for scheduling.
  • Inserted a logging statement for debugging task execution and included an explicit guard for non-array index values in the scheduler.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/scheduled_task/batch/ScheduledTaskRunner/KScheduledTaskRunner.class.php Introduces helper method to calculate the partner-specific task index and adds logging in run()
batch/scheduler/KGenericScheduler.class.php Wraps the non-array check for task indexes in braces for clarity

$mrNumberOfWorkers = $this->getParams('mrNumberOfWorkers');
if($mrNumberOfWorkers)
{
$index = ($partnerId / 10) % $mrNumberOfWorkers;
Copy link
Preview

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider explicitly casting ($partnerId / 10) to an integer before applying the modulo to ensure the arithmetic behaves as expected, since PHP division returns a float.

Suggested change
$index = ($partnerId / 10) % $mrNumberOfWorkers;
$index = (int)($partnerId / 10) % $mrNumberOfWorkers;

Copilot uses AI. Check for mistakes.

@danbar0kal danbar0kal changed the base branch from Ursa-21.17.0 to Ursa-21.18.0 June 17, 2025 07:47
@danbar0kal danbar0kal changed the base branch from Ursa-21.18.0 to Ursa-21.19.0 June 23, 2025 09:25
@danbar0kal danbar0kal changed the base branch from Ursa-21.19.0 to Venus-22.0.0 July 21, 2025 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants