mirror of
https://github.com/nextcloud/server.git
synced 2026-02-24 10:26:07 -05:00
Merge pull request #37702 from nextcloud/backport/37617/stable25
[stable25] handle not being able to write file for notify self-test
This commit is contained in:
commit
b4f562bc2f
2 changed files with 7 additions and 1 deletions
|
|
@ -333,7 +333,10 @@ class Notify extends Base {
|
|||
|
||||
private function selfTest(IStorage $storage, INotifyHandler $notifyHandler, OutputInterface $output) {
|
||||
usleep(100 * 1000); //give time for the notify to start
|
||||
$storage->file_put_contents('/.nc_test_file.txt', 'test content');
|
||||
if (!$storage->file_put_contents('/.nc_test_file.txt', 'test content')) {
|
||||
$output->writeln("Failed to create test file for self-test");
|
||||
return;
|
||||
}
|
||||
$storage->mkdir('/.nc_test_folder');
|
||||
$storage->file_put_contents('/.nc_test_folder/subfile.txt', 'test content');
|
||||
|
||||
|
|
|
|||
|
|
@ -207,6 +207,9 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
|
|||
|
||||
public function file_put_contents($path, $data) {
|
||||
$handle = $this->fopen($path, "w");
|
||||
if (!$handle) {
|
||||
return false;
|
||||
}
|
||||
$this->removeCachedFile($path);
|
||||
$count = fwrite($handle, $data);
|
||||
fclose($handle);
|
||||
|
|
|
|||
Loading…
Reference in a new issue