diff --git a/diskover/CHANGELOG.md b/diskover/CHANGELOG.md index be4726ab..351f29ca 100644 --- a/diskover/CHANGELOG.md +++ b/diskover/CHANGELOG.md @@ -1,5 +1,12 @@ # Diskover v2 Community Edition Change Log +# [2.2.2] - 2023-12-12 +### added +- index gets deleted if diskover.py exits with critical error +### fixed +- moved plugin init call below create_index() so we can access the current index + + # [2.2.1] - 2023-11-03 ### changed - version change only diff --git a/diskover/diskover.py b/diskover/diskover.py index c724af70..c7917bee 100644 --- a/diskover/diskover.py +++ b/diskover/diskover.py @@ -1332,37 +1332,28 @@ def log_setup(): logger.info('Config file: {0}'.format(config_filename)) logger.info('Config env var DISKOVERDIR: {0}'.format(os.getenv('DISKOVERDIR'))) - # print plugins - if plugins_enabled and plugins: - plugins_list = '' - for pi in get_plugins_info(): - plugins_list = plugins_list + pi['name'] + ' ' - logger.info('Plugins loaded: {0}'.format(plugins_list)) - else: - logger.info('No plugins loaded') - - # init and print plugins - if plugins_enabled and plugins: - for plugin in plugins: - if hasattr(plugin, 'init'): - try: - plugin.init(globals()) - except Exception as e: - raise PluginError(e) - # print plugins - if plugins_enabled and plugins: - plugins_list = '' - for pi in get_plugins_info(): - plugins_list = plugins_list + pi['name'] + ' ' - logger.info('Plugins loaded: {0}'.format(plugins_list)) - else: - logger.info('No plugins loaded') - try: logger.info('Creating index {0}...'.format(options.index)) create_index(options.index, es) tune_index(es, options.index) + + # init plugins + if plugins_enabled and plugins: + for plugin in plugins: + if hasattr(plugin, 'init'): + try: + plugin.init(globals()) + except Exception as e: + raise PluginError(e) + # print plugins + if plugins_enabled and plugins: + plugins_list = '' + for pi in get_plugins_info(): + plugins_list = plugins_list + pi['name'] + ' ' + logger.info('Plugins loaded: {0}'.format(plugins_list)) + else: + logger.info('No plugins loaded') # check for thread config override if options.threads: