less spam
This commit is contained in:
parent
473fc38457
commit
005add84bd
2 changed files with 11 additions and 3 deletions
|
|
@ -14,17 +14,23 @@ import {
|
|||
import { PickKeysByType } from 'typeorm/common/PickKeysByType.js';
|
||||
import { serializeRequest, WhereCondition } from './serializationHelpers.js';
|
||||
|
||||
|
||||
export type TX<T> = (txId: string) => Promise<T>
|
||||
|
||||
export class StorageInterface extends EventEmitter {
|
||||
private process: any;
|
||||
private isConnected: boolean = false;
|
||||
private debug: boolean = false;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.initializeSubprocess();
|
||||
}
|
||||
|
||||
setDebug(debug: boolean) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
private initializeSubprocess() {
|
||||
this.process = fork('./build/src/services/storage/storageProcessor');
|
||||
|
||||
|
|
@ -131,11 +137,11 @@ export class StorageInterface extends EventEmitter {
|
|||
}
|
||||
|
||||
private handleOp<T>(op: IStorageOperation): Promise<T> {
|
||||
console.log('handleOp', op)
|
||||
if (this.debug) console.log('handleOp', op)
|
||||
this.checkConnected()
|
||||
return new Promise<T>((resolve, reject) => {
|
||||
const responseHandler = (response: OperationResponse<T>) => {
|
||||
console.log('responseHandler', response)
|
||||
if (this.debug) console.log('responseHandler', response)
|
||||
if (!response.success) {
|
||||
reject(new Error(response.error));
|
||||
return
|
||||
|
|
@ -169,6 +175,7 @@ export class StorageInterface extends EventEmitter {
|
|||
if (this.process) {
|
||||
this.process.kill();
|
||||
this.isConnected = false;
|
||||
this.debug = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ export const ignore = false
|
|||
export const dev = false
|
||||
|
||||
export default async (T: TestBase) => {
|
||||
T.main.storage.dbs.setDebug(true)
|
||||
await safelySetUserBalance(T, T.user1, 2000)
|
||||
await openAdminChannel(T)
|
||||
await runSanityCheck(T)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue