mirror of https://github.com/djcb/mu.git
* mu-index: improve stats
This commit is contained in:
parent
1ce4469bca
commit
620b7dc8c3
|
@ -81,7 +81,6 @@ mu_index_destroy (MuIndex *index)
|
||||||
g_free (index);
|
g_free (index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
struct _MuIndexCallbackData {
|
struct _MuIndexCallbackData {
|
||||||
MuIndexMsgCallback _idx_msg_cb;
|
MuIndexMsgCallback _idx_msg_cb;
|
||||||
MuIndexDirCallback _idx_dir_cb;
|
MuIndexDirCallback _idx_dir_cb;
|
||||||
|
@ -93,6 +92,7 @@ struct _MuIndexCallbackData {
|
||||||
};
|
};
|
||||||
typedef struct _MuIndexCallbackData MuIndexCallbackData;
|
typedef struct _MuIndexCallbackData MuIndexCallbackData;
|
||||||
|
|
||||||
|
|
||||||
static MuResult
|
static MuResult
|
||||||
insert_or_update_maybe (const char* fullpath, time_t filestamp,
|
insert_or_update_maybe (const char* fullpath, time_t filestamp,
|
||||||
MuIndexCallbackData *data, gboolean *updated)
|
MuIndexCallbackData *data, gboolean *updated)
|
||||||
|
@ -101,11 +101,9 @@ insert_or_update_maybe (const char* fullpath, time_t filestamp,
|
||||||
|
|
||||||
*updated = FALSE;
|
*updated = FALSE;
|
||||||
|
|
||||||
if ((size_t)filestamp <= (size_t)data->_dirstamp) {
|
if (!data->_reindex && (size_t)filestamp <= (size_t)data->_dirstamp)
|
||||||
if (!data->_reindex)
|
return MU_OK;
|
||||||
return MU_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg = mu_msg_gmime_new (fullpath);
|
msg = mu_msg_gmime_new (fullpath);
|
||||||
if (!msg) {
|
if (!msg) {
|
||||||
g_warning ("%s: failed to create mu_msg for %s",
|
g_warning ("%s: failed to create mu_msg for %s",
|
||||||
|
@ -121,8 +119,8 @@ insert_or_update_maybe (const char* fullpath, time_t filestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
mu_msg_gmime_destroy (msg);
|
mu_msg_gmime_destroy (msg);
|
||||||
|
|
||||||
*updated = TRUE;
|
*updated = TRUE;
|
||||||
|
|
||||||
return MU_OK;
|
return MU_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +156,7 @@ on_run_maildir_msg (const char* fullpath, time_t filestamp,
|
||||||
&updated);
|
&updated);
|
||||||
|
|
||||||
/* update statistics */
|
/* update statistics */
|
||||||
if (result == MU_OK && data && data->_stats) {
|
if (data && data->_stats) {
|
||||||
++data->_stats->_processed;
|
++data->_stats->_processed;
|
||||||
if (data && data->_stats) {
|
if (data && data->_stats) {
|
||||||
if (updated)
|
if (updated)
|
||||||
|
|
Loading…
Reference in New Issue