[Groonga-commit] groonga/groonga at 489b404 [master] Export grn_db_get_last_modified()

Back to archive index

Kouhei Sutou null+****@clear*****
Wed May 11 10:12:35 JST 2016


Kouhei Sutou	2016-05-11 10:12:35 +0900 (Wed, 11 May 2016)

  New Revision: 489b4049a593feb039bcb262c51acee96e11aaa3
  https://github.com/groonga/groonga/commit/489b4049a593feb039bcb262c51acee96e11aaa3

  Message:
    Export grn_db_get_last_modified()

  Modified files:
    include/groonga/db.h
    lib/cache.c
    lib/db.c
    lib/grn_db.h

  Modified: include/groonga/db.h (+1 -0)
===================================================================
--- include/groonga/db.h    2016-05-11 09:57:51 +0900 (67eb232)
+++ include/groonga/db.h    2016-05-11 10:12:35 +0900 (638c1f6)
@@ -38,6 +38,7 @@ GRN_API grn_obj *grn_db_open(grn_ctx *ctx, const char *path);
 GRN_API void grn_db_touch(grn_ctx *ctx, grn_obj *db);
 GRN_API grn_rc grn_db_recover(grn_ctx *ctx, grn_obj *db);
 GRN_API grn_rc grn_db_unmap(grn_ctx *ctx, grn_obj *db);
+GRN_API uint32_t grn_db_get_last_modified(grn_ctx *ctx, grn_obj *db);
 
 #ifdef __cplusplus
 }

  Modified: lib/cache.c (+1 -1)
===================================================================
--- lib/cache.c    2016-05-11 09:57:51 +0900 (068e295)
+++ lib/cache.c    2016-05-11 10:12:35 +0900 (6e2e34a)
@@ -182,7 +182,7 @@ grn_cache_fetch(grn_ctx *ctx, grn_cache *cache,
   MUTEX_LOCK(cache->mutex);
   cache->nfetches++;
   if (grn_hash_get(cache->ctx, cache->hash, str, str_len, (void **)&ce)) {
-    if (ce->tv.tv_sec <= grn_db_lastmod(ctx->impl->db)) {
+    if (ce->tv.tv_sec <= grn_db_get_last_modified(ctx, ctx->impl->db)) {
       grn_cache_expire_entry(cache, ce);
       goto exit;
     }

  Modified: lib/db.c (+2 -2)
===================================================================
--- lib/db.c    2016-05-11 09:57:51 +0900 (f213a3d)
+++ lib/db.c    2016-05-11 10:12:35 +0900 (f97a676)
@@ -648,9 +648,9 @@ grn_obj_io(grn_obj *obj)
 }
 
 uint32_t
-grn_db_lastmod(grn_obj *s)
+grn_db_get_last_modified(grn_ctx *ctx, grn_obj *db)
 {
-  return grn_obj_io(s)->header->lastmod;
+  return grn_obj_io(db)->header->lastmod;
 }
 
 void

  Modified: lib/grn_db.h (+0 -2)
===================================================================
--- lib/grn_db.h    2016-05-11 09:57:51 +0900 (b503608)
+++ lib/grn_db.h    2016-05-11 10:12:35 +0900 (5c8f601)
@@ -64,8 +64,6 @@ GRN_API grn_rc grn_db_close(grn_ctx *ctx, grn_obj *db);
 
 grn_obj *grn_db_keys(grn_obj *s);
 
-uint32_t grn_db_lastmod(grn_obj *s);
-
 grn_rc _grn_table_delete_by_id(grn_ctx *ctx, grn_obj *table, grn_id id,
                                grn_table_delete_optarg *optarg);
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index