fix timing issue related validity set among threads 13/167213/1
authorchen89.chen <chen89.chen@samsung.com>
Tue, 16 Jan 2018 08:03:39 +0000 (16:03 +0800)
committerhj kim <backto.kim@samsung.com>
Tue, 16 Jan 2018 07:25:56 +0000 (16:25 +0900)
Change-Id: Ifed7a2a0d5243f2c89d007b204205222c9f5e13b

src/scanner-v2/media-scanner-scan-v2.c

index d0a57af..56ce882 100755 (executable)
@@ -295,9 +295,9 @@ static int __msc_dir_scan_for_folder(void **handle, const char *storage_id, cons
 
        is_recursive = (scan_type == MS_MSG_DIRECTORY_SCANNING_NON_RECURSIVE) ? false : true;
 
-       /* folder validity set 0 under the start_path in folder table*/
-       if (ms_set_folder_validity(handle, storage_id, new_start_path, MS_INVALID, is_recursive, uid) != MS_MEDIA_ERR_NONE)
-               MS_DBG_ERR("set_folder_validity failed [%d] ", scan_type);
+       /* fix timing issue, folder uuid of start path mismatch in folder and media table*/
+       /*if (ms_set_folder_validity(handle, storage_id, new_start_path, MS_INVALID, is_recursive, uid) != MS_MEDIA_ERR_NONE)
+               MS_DBG_ERR("set_folder_validity failed [%d] ", scan_type);*/
 
        if (g_file_test(new_start_path, G_FILE_TEST_IS_DIR)) {
                if (ms_insert_folder(handle, storage_id, new_start_path, uid) != MS_MEDIA_ERR_NONE)
@@ -1223,7 +1223,8 @@ gboolean msc_directory_scan_thread(void *data)
                                if (scan_status == MS_DIR_SCAN_DONE) {
                                        /* do nothing */
                                        MS_DBG_WARN("[%s] scan done", scan_data->msg);
-                                       err = ms_set_folder_item_validity(handle, storage_id, scan_data->msg, MS_VALIND, MS_NON_RECURSIVE, uid);
+                                       /*fix timing issue, deleted items scanned by storage scan is set validity 1 again*/
+                                       /*err = ms_set_folder_item_validity(handle, storage_id, scan_data->msg, MS_VALIND, MS_NON_RECURSIVE, uid);*/
                                        goto SCAN_DONE;
                                } else if (scan_status == MS_DIR_SCAN_PROCESSING) {
                                        MS_DBG_WARN("[%s] scanning, waiting...", scan_data->msg);