Skip to content

Commit 3ae47e2

Browse files
author
HD Moore
committed
Move the thread tracking into the update method
1 parent 51673ca commit 3ae47e2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/msf/core/db_manager.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ def update_all_module_details
342342
return if not self.migrated
343343
return if self.modules_caching
344344

345+
self.framework.cache_thread = Thread.current
346+
345347
self.modules_cached = false
346348
self.modules_caching = true
347349

@@ -394,6 +396,9 @@ def update_all_module_details
394396
end
395397
end
396398

399+
self.framework.cache_initialized = true
400+
self.framework.cache_thread = nil
401+
397402
self.modules_cached = true
398403
self.modules_caching = false
399404

lib/msf/ui/console/driver.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ def initialize(prompt = DefaultPrompt, prompt_char = DefaultPromptChar, opts = {
228228

229229
# Rebuild the module cache in a background thread
230230
self.framework.threads.spawn("ModuleCacheRebuild", true) do
231-
self.framework.cache_thread = Thread.current
232231
self.framework.modules.refresh_cache_from_module_files
233-
self.framework.cache_initialized = true
234-
self.framework.cache_thread = nil
235232
end
236233
end
237234

0 commit comments

Comments
 (0)