lib/localPersistence/localPersistenceManager.js
/**
   * Initializes the databases and management level.
   *
   * @public
   */
Initializes the databases and management level.
@public
Initializes the databases and management level . @public
async init() {
    this.logger.info('Initializing database...');
    try {
      this.db = await levelAsync(this.databasePath);
      this.logger.info('Database initialized successfully');
      this.logger.debug('Initializing level manager...');
      this.managementLevel = subleveldown(this.db, 'managementLevel', { keyEncoding: 'utf8', valueEncoding: 'json' });
      this.logger.debug('Level manager initialized');
      if (this.readInMemory) {
        await this.copyLevelsToMemory();
      }
    } catch (error) {
      this.logger.debug('Database initialize error');
      this.logger.error(error.message);
      throw error;
    }
  }
async init ( ) { this . logger . info ( 'Initializing database...' ) ; try { this . db = await levelAsync ( this . databasePath ) ; this . logger . info ( 'Database initialized successfully' ) ; this . logger . debug ( 'Initializing level manager...' ) ; this . managementLevel = subleveldown ( this . db , 'managementLevel' , { keyEncoding : 'utf8' , valueEncoding : 'json' } ) ; this . logger . debug ( 'Level manager initialized' ) ; if ( this . readInMemory ) { await this . copyLevelsToMemory ( ) ; } } catch ( error ) { this . logger . debug ( 'Database initialize error' ) ; this . logger . error ( error . message ) ; throw error ; } }
Initializes the databases and management level.
Initializes the databases and management level .