This commit is contained in:
Daniil Gentili 2024-03-28 23:04:40 +01:00
parent cc6c6fc341
commit bca7169b3e
5 changed files with 8 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
a.php
.phpunit.cache
/vendor/
*.cache

View File

@ -19,7 +19,7 @@
namespace danog\AsyncOrm;
use danog\AsyncOrm\Annotations\OrmMappedArray;
use danog\AsyncOrm\Driver\CachedArray;
use danog\AsyncOrm\Internal\Driver\CachedArray;
use danog\AsyncOrm\Settings\DriverSettings;
use danog\AsyncOrm\Settings\Mysql;
use ReflectionClass;

View File

@ -3,7 +3,7 @@
namespace danog\AsyncOrm;
use AssertionError;
use danog\AsyncOrm\Driver\CachedArray;
use danog\AsyncOrm\Internal\Driver\CachedArray;
use danog\AsyncOrm\Internal\Driver\ObjectArray;
use danog\AsyncOrm\Serializer\Json;
use danog\AsyncOrm\Settings\DriverSettings;

View File

@ -16,11 +16,12 @@
* @link https://daniil.it/AsyncOrm AsyncOrm documentation
*/
namespace danog\AsyncOrm\Driver;
namespace danog\AsyncOrm\Internal\Driver;
use danog\AsyncOrm\DbArray;
use danog\AsyncOrm\FieldConfig;
use danog\AsyncOrm\Internal\Containers\CacheContainer;
use Revolt\EventLoop;
use Traversable;
/**
@ -64,6 +65,7 @@ final class CachedArray extends DbArray
public function __destruct()
{
$this->cache->stopCacheCleanupLoop();
EventLoop::queue($this->cache->flushCache(...));
}
public function flushCache(): void

View File

@ -23,9 +23,9 @@ use Amp\Process\Process;
use Amp\Redis\RedisConfig;
use AssertionError;
use danog\AsyncOrm\DbObject;
use danog\AsyncOrm\Driver\CachedArray;
use danog\AsyncOrm\Driver\MemoryArray;
use danog\AsyncOrm\FieldConfig;
use danog\AsyncOrm\Internal\Driver\CachedArray;
use danog\AsyncOrm\Internal\Driver\ObjectArray;
use danog\AsyncOrm\KeyType;
use danog\AsyncOrm\Serializer\Igbinary;
@ -402,7 +402,7 @@ final class OrmTest extends TestCase
[ValueType::BOOL, false],
// Uncomment when segfaults are fixed
//[ValueType::OBJECT, new TestObject],
[ValueType::OBJECT, new TestObject],
[ValueType::SCALAR, 'test'],
[ValueType::SCALAR, 123],