From 01636191bc8ee0a109a50ca9441f01a14d273a02 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 11 Nov 2020 03:21:02 +0100 Subject: Matrix: do not save to sync file on error --- src/plugins/Matrix.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index d6034de..ce003a0 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -1099,12 +1099,8 @@ namespace QuickMedia { } #endif - sync_end: - if(sync_running) - std::this_thread::sleep_for(std::chrono::milliseconds(500)); - // TODO: Circulate file - FILE *sync_cache_file = fopen(matrix_cache_dir.data.c_str(), initial_sync ? "wb" : "ab"); + sync_cache_file = fopen(matrix_cache_dir.data.c_str(), initial_sync ? "wb" : "ab"); initial_sync = false; if(sync_cache_file) { if(json_root.IsObject()) { @@ -1116,6 +1112,10 @@ namespace QuickMedia { } fclose(sync_cache_file); } + + sync_end: + if(sync_running) + std::this_thread::sleep_for(std::chrono::milliseconds(500)); } }); } -- cgit v1.2.3