Fix up cloud log state counting.
[bluesky.git] / bluesky / cloudlog.c
index 142104f..9d5333f 100644 (file)
@@ -282,6 +282,7 @@ void bluesky_cloudlog_fetch(BlueSkyCloudLog *log)
      * Once that is done, we can fall through the case of remapping the data
      * itself. */
     if (log->type == LOGTYPE_UNKNOWN) {
+        bluesky_cloudlog_stats_update(log, -1);
         BlueSkyRCStr *raw = NULL;
         if ((log->location_flags | log->pending_write) & CLOUDLOG_JOURNAL) {
             raw = bluesky_log_map_object(log->fs, -1, log->log_seq,
@@ -300,6 +301,7 @@ void bluesky_cloudlog_fetch(BlueSkyCloudLog *log)
         g_assert(raw != NULL);
         bluesky_deserialize_cloudlog(log, raw->data, raw->len);
         bluesky_string_unref(raw);
+        bluesky_cloudlog_stats_update(log, 1);
     }
 
     /* At this point all metadata should be available and we need only remap