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

[stable25] fix(cron): Log long running jobs #46716

Closed
wants to merge 1 commit into from

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jul 24, 2024

Backport of PR #45855

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@backportbot backportbot bot added bug 3. to review Waiting for reviews labels Jul 24, 2024
@ChristophWurst ChristophWurst changed the title [stable25] [stable27] fix(cron): Log long running jobs [stable25] fix(cron): Log long running jobs Jul 24, 2024
@AndyScherzinger
Copy link
Member

@ChristophWurst php 7.4 linter fails (for a reasons I would say):

PHP Parse error:  syntax error, unexpected '=>' (T_DOUBLE_ARROW) in ./cron.php on line 160
Errors parsing ./cron.php

Comment on lines +159 to +165
$logLevel = match (true) {
$timeSpent > $cronInterval * 128 => \OCP\ILogger::FATAL,
$timeSpent > $cronInterval * 64 => \OCP\ILogger::ERROR,
$timeSpent > $cronInterval * 16 => \OCP\ILogger::WARN,
$timeSpent > $cronInterval * 8 => \OCP\ILogger::INFO,
default => \OCP\ILogger::DEBUG,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not work match was introduced with PHP 8.0 so you need to use switch-case

Copy link
Contributor

Choose a reason for hiding this comment

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

@ChristophWurst looks like backporting won't be possible here :(

@ChristophWurst
Copy link
Member

ChristophWurst commented Aug 7, 2024

@AndyScherzinger @sorbaugh I did not intend to get this merged. @marinofaggiana needed a patch to debug a production system, for which this PR is sufficient as long as it's not used with old PHP. See #45804 (comment).

We can close the PR. 25 is EOL.

@susnux susnux closed this Aug 8, 2024
@susnux susnux deleted the backport/45855/stable25 branch August 8, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants