Changeset 9

Show
Ignore:
Timestamp:
12/02/04 16:04:38 (4 years ago)
Author:
azrael
Message:

Moved the opening and closing of the hashtable to connect
and disconnect to not keep the database open for too long

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/file-sync/src/file_sync.c

    r2 r9  
    5656        fsinfo->member = member; 
    5757        fsinfo->hashtable = osync_hashtable_new(); 
    58         osync_hashtable_load(fsinfo->hashtable, member); 
    5958 
    6059#ifdef HAVE_FAM 
     
    8988        GError *direrror = NULL; 
    9089        fsinfo->dir = g_dir_open(fsinfo->path, 0, &direrror); 
     90        osync_hashtable_load(fsinfo->hashtable, fsinfo->member); 
    9191         
    9292        if (!osync_anchor_compare(fsinfo->member, fsinfo->path)) 
     
    207207        osync_debug("FILE-SYNC", 4, "start: %s", __func__); 
    208208        osync_debug("FILE-SYNC", 3, "Writing change %s with changetype %i", osync_change_get_uid(change), osync_change_get_changetype(change)); 
    209         fs_access(ctx, change); 
     209        if (!fs_access(ctx, change)) 
     210                return; 
    210211 
    211212        filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); 
     
    227228        filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); 
    228229        g_dir_close(fsinfo->dir); 
     230        osync_hashtable_close(fsinfo->hashtable); 
    229231        osync_context_report_success(ctx); 
    230232} 
     
    234236        osync_debug("FILE-SYNC", 4, "start: %s", __func__); 
    235237        filesyncinfo *fsinfo = (filesyncinfo *)data; 
    236         osync_hashtable_close(fsinfo->hashtable); 
    237238        osync_hashtable_free(fsinfo->hashtable); 
    238239#ifdef HAVE_FAM