(
env: AutoRoutingModeEnv,
owner: { ownerType: AutoRoutingModeOwnerType; ownerId: string }
)
| 40 | |
| 41 | async setMode(mode: AutoRoutingMode | null): Promise<void> { |
| 42 | if (mode === null) { |
| 43 | await this.ctx.storage.delete(MODE_STORAGE_KEY); |
| 44 | return; |
| 45 | } |
| 46 | await this.ctx.storage.put(MODE_STORAGE_KEY, mode); |
| 47 | } |
| 48 | |
| 49 | async getPool(): Promise<EfficientModelPool | null> { |
| 50 | return parseStoredPool(await this.ctx.storage.get(POOL_STORAGE_KEY)); |
| 51 | } |
| 52 | |
| 53 | async setPool(pool: EfficientModelPool | null): Promise<void> { |
| 54 | if (pool === null) { |
| 55 | await this.ctx.storage.delete(POOL_STORAGE_KEY); |
| 56 | return; |
| 57 | } |
| 58 | await this.ctx.storage.put(POOL_STORAGE_KEY, pool); |
| 59 | } |
| 60 | |
| 61 | async getSettings(): Promise<AutoRoutingOwnerSettings> { |
no test coverage detected