mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 03:26:07 +00:00
29298dcfe5
storage_reclaim_marks records since when the reclaim pass has seen an object unreferenced, keyed by category and key. A mark is never moved forward, so its age is how long the object has been unreferenced without a break; it goes once the object is named again or gone. Owned by the storage domain.
24 lines
740 B
TypeScript
24 lines
740 B
TypeScript
import { EntityRepositoryType, PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';
|
|
import { StorageReclaimMarksRepository } from '../repositories/StorageReclaimMarks.repository';
|
|
import { DbTimestampType } from '../types';
|
|
|
|
export class StorageReclaimMarks {
|
|
[EntityRepositoryType]?: StorageReclaimMarksRepository;
|
|
[PrimaryKeyProp]?: ['category', 'key'];
|
|
category!: string;
|
|
key!: string;
|
|
first_seen_at!: string;
|
|
size!: number;
|
|
}
|
|
|
|
export const StorageReclaimMarksSchema = defineEntity({
|
|
class: StorageReclaimMarks,
|
|
repository: () => StorageReclaimMarksRepository,
|
|
properties: {
|
|
category: p.text().primary(),
|
|
key: p.text().primary(),
|
|
first_seen_at: p.type(DbTimestampType),
|
|
size: p.integer(),
|
|
},
|
|
});
|