Skip to content

Commit 16dcdc4

Browse files
mmahroussfda-odoo
authored andcommitted
[FIX] server: check for odoo path existence in delayed thread
1 parent 3f14b85 commit 16dcdc4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

server/src/threads.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,11 @@ pub fn delayed_changes_process_thread(sender_session: Sender<Message>, receiver_
192192
let check_reset = |msg: Option<&DelayedProcessingMessage>| {
193193
let length = sync_odoo.lock().unwrap().watched_file_updates.load(Ordering::SeqCst);
194194
if length > 10 {
195-
let main_entry_path = sync_odoo.lock().unwrap().config.odoo_path.as_ref().unwrap().clone();
196-
let index_lock_path = PathBuf::from(main_entry_path).join(".git").join("index.lock");
197-
while index_lock_path.exists(){
198-
std::thread::sleep(std::time::Duration::from_secs(1));
195+
if let Some(main_entry_path) = sync_odoo.lock().unwrap().config.odoo_path.as_ref().cloned() {
196+
let index_lock_path = PathBuf::from(main_entry_path).join(".git").join("index.lock");
197+
while index_lock_path.exists(){
198+
std::thread::sleep(std::time::Duration::from_secs(1));
199+
}
199200
}
200201
let message = "Too many requests, possible change of branch, restarting Odoo LS";
201202
info!(message);

0 commit comments

Comments
 (0)