Pārlūkot izejas kodu

fix(core): Use correct precision for CacheItem.expiresAt

Because no precision was specified, this meant that MariaDB would
default to a granularity of seconds, which meant that the e2e tests
for sub-second TTLs would intermittently fail.

BREAKING CHANGE: If you are using the DefaultCachePlugin, then
you should generate a migration that adds `precision(3)` to the
`expiresAt` column. This will only affect cache records so no prod
data will be affected by it.
Michael Bromley 11 mēneši atpakaļ
vecāks
revīzija
12e2db0550

+ 1 - 1
packages/core/src/plugin/default-cache-plugin/cache-item.entity.ts

@@ -19,6 +19,6 @@ export class CacheItem extends VendureEntity {
     @Column('text')
     @Column('text')
     value: string;
     value: string;
 
 
-    @Column({ nullable: true })
+    @Column({ nullable: true, precision: 3 })
     expiresAt?: Date;
     expiresAt?: Date;
 }
 }