fix(core): update
This commit is contained in:
@@ -7,6 +7,11 @@ export interface IAppDataOptions<T = any> {
|
||||
dirPath?: string;
|
||||
requiredKeys?: Array<keyof T>;
|
||||
|
||||
/**
|
||||
* wether keys should be persisted on disk or not
|
||||
*/
|
||||
ephermal?: boolean;
|
||||
|
||||
/**
|
||||
* kvStoreKey: 'MY_ENV_VAR'
|
||||
*/
|
||||
@@ -43,7 +48,7 @@ export class AppData<T = any> {
|
||||
* @param pathArg
|
||||
*/
|
||||
private async init(pathArg?: string) {
|
||||
if (this.options.dirPath) {
|
||||
if (this.options.dirPath || this.options.ephermal) {
|
||||
// ok, nothing to do here;
|
||||
} else {
|
||||
const appDataDir = '/app/data';
|
||||
@@ -62,7 +67,7 @@ export class AppData<T = any> {
|
||||
}
|
||||
|
||||
this.kvStore = new KeyValueStore<T>({
|
||||
typeArg: 'custom',
|
||||
typeArg: this.options.ephermal ? 'ephemeral' : 'custom',
|
||||
identityArg: 'appkv',
|
||||
customPath: this.options.dirPath,
|
||||
mandatoryKeys: this.options.requiredKeys as Array<keyof T>
|
||||
|
Reference in New Issue
Block a user