Skip to content

Commit

Permalink
Fix a bug that would duplicate files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Kamina committed Jul 16, 2024
1 parent 561ae5c commit 1d6f667
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions deluge/pluginmanagerbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def on_started(result, instance):
)
self.config['enabled_plugins'].append(plugin_name_space)
log.info('Plugin %s enabled...', plugin_name_space)
PluginResourceManager.prepare_for(plugin_name_space)
PluginResourceManager.prepare_for(instance.__module__)
return True

def on_started_error(result, instance):
Expand Down Expand Up @@ -244,6 +244,7 @@ def disable_plugin(self, name):
return defer.succeed(True)

try:
module_name = self.plugins[name].__module__
d = defer.maybeDeferred(self.plugins[name].disable)
except Exception as ex:
log.error('Error when disabling plugin: %s', self.plugin._component_name)
Expand All @@ -267,7 +268,7 @@ def on_disabled(result):
ret = False
else:
log.info('Plugin %s disabled...', name)
PluginResourceManager.clear_for(name)
PluginResourceManager.clear_for(module_name)
return ret

d.addBoth(on_disabled)
Expand Down

0 comments on commit 1d6f667

Please sign in to comment.