-
Notifications
You must be signed in to change notification settings - Fork 7
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
Rotation fails on files that already end in .1 #10
Comments
I've tried to replicate the problem but I can't. I have published a PR #11 with a test for this issue, but the tests pass and calls to the then method occur correctly. Could you tell me what version you have installed and what platform does it run on? |
Odd. I'm on PHP 7.4.3 and Ubuntu 20.04.3 and it happens very consistently. |
@kkjdroid , Could you tell me what version of the package you have installed? |
2.4.0 |
I just published version 2.5.0, where you have a new method Please, update the package and test with: $rotation = new Rotation();
$rotation->finally(function($message) {
echo $message. PHP_EOL;
})->rotate('error.log.1'); |
~~Oddly, it seems to work perfectly fine now. Thanks for your help with this
issue.~~
|
It's now very inconsistent. I got debug.log.1.1 to rotate to debug.log.1.1.1 and then debug.log.1.1.2, but now it won't create debug.log.1.1.3. Here is my code: debug_log('test');
$new_path = (new Rotation)
->compress(false)
->files(366)
->minSize(0)
->then(function($new_path, $old_path)
{
debug_log($new_path);
debug_log($old_path);
file_put_contents($old_path, '');
return $new_path;
})
->catch(function($e)
{
debug_log('then');
debug_log($e);
})
->finally(function($message)
{
debug_log('finally');
debug_log($message);
})
->rotate($path); And the log output that it creates:
|
Trying to rotate
error.log.1
will sometimes result in anerror.log.1.1
, but iferror.log.1.1
exists then trying to rotateerror.log.1
will produce no new file and will not call either thethen()
or thecatch()
callback.The text was updated successfully, but these errors were encountered: