Add mutex on datastore I/O operations
To make sure that there is no concurrent operation on the datastore file. Fixes #1132
This commit is contained in:
parent
458b6b9918
commit
fd1ddad98d
26 changed files with 218 additions and 63 deletions
tests/updater
|
@ -2,6 +2,7 @@
|
|||
namespace Shaarli\Updater;
|
||||
|
||||
use Exception;
|
||||
use malkusch\lock\mutex\NoMutex;
|
||||
use Shaarli\Bookmark\BookmarkFileService;
|
||||
use Shaarli\Bookmark\BookmarkServiceInterface;
|
||||
use Shaarli\Config\ConfigManager;
|
||||
|
@ -44,12 +45,13 @@ class UpdaterTest extends TestCase
|
|||
*/
|
||||
protected function setUp(): void
|
||||
{
|
||||
$mutex = new NoMutex();
|
||||
$this->refDB = new \ReferenceLinkDB();
|
||||
$this->refDB->write(self::$testDatastore);
|
||||
|
||||
copy('tests/utils/config/configJson.json.php', self::$configFile .'.json.php');
|
||||
$this->conf = new ConfigManager(self::$configFile);
|
||||
$this->bookmarkService = new BookmarkFileService($this->conf, $this->createMock(History::class), true);
|
||||
$this->bookmarkService = new BookmarkFileService($this->conf, $this->createMock(History::class), $mutex, true);
|
||||
$this->updater = new Updater([], $this->bookmarkService, $this->conf, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue