diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-24 12:00:20 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-24 12:00:20 +0200 |
commit | d77354b11ad73834aa75d4e61874b7bb901c1aa3 (patch) | |
tree | 792bce7a06ae41eb268641a2c9edc2d2eba89930 /src/exchangedb | |
parent | 8e71a7e4de8c07767e8e11e745d9a7fc3bacc94f (diff) | |
download | exchange-d77354b11ad73834aa75d4e61874b7bb901c1aa3.tar.xz |
use precise time for shards
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 5924c9bfe..d0d6ca18b 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -12946,17 +12946,16 @@ postgres_begin_shard (void *cls, case GNUNET_DB_STATUS_SUCCESS_ONE_RESULT: { enum GNUNET_DB_QueryStatus qs; - struct GNUNET_TIME_Timestamp now; + struct GNUNET_TIME_Absolute now; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (job_name), - GNUNET_PQ_query_param_timestamp (&now), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_uint64 (start_row), GNUNET_PQ_query_param_uint64 (end_row), GNUNET_PQ_query_param_end }; - now = GNUNET_TIME_absolute_to_timestamp ( - GNUNET_TIME_relative_to_absolute (delay)); + now = GNUNET_TIME_relative_to_absolute (delay); qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, "reclaim_shard", params); @@ -13021,17 +13020,16 @@ postgres_begin_shard (void *cls, /* Claim fresh shard */ { enum GNUNET_DB_QueryStatus qs; - struct GNUNET_TIME_Timestamp now; + struct GNUNET_TIME_Absolute now; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (job_name), - GNUNET_PQ_query_param_timestamp (&now), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_uint64 (start_row), GNUNET_PQ_query_param_uint64 (end_row), GNUNET_PQ_query_param_end }; - now = GNUNET_TIME_absolute_to_timestamp ( - GNUNET_TIME_relative_to_absolute (delay)); + now = GNUNET_TIME_relative_to_absolute (delay); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Trying to claim shard (%llu-%llu]\n", (unsigned long long) *start_row, @@ -13222,10 +13220,10 @@ postgres_begin_revolving_shard (void *cls, { /* Claim fresh shard */ enum GNUNET_DB_QueryStatus qs; - struct GNUNET_TIME_Timestamp now; + struct GNUNET_TIME_Absolute now; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_string (job_name), - GNUNET_PQ_query_param_timestamp (&now), + GNUNET_PQ_query_param_absolute_time (&now), GNUNET_PQ_query_param_uint32 (start_row), GNUNET_PQ_query_param_uint32 (end_row), GNUNET_PQ_query_param_end @@ -13233,7 +13231,7 @@ postgres_begin_revolving_shard (void *cls, *end_row = GNUNET_MIN (shard_limit, *start_row + shard_size - 1); - now = GNUNET_TIME_timestamp_get (); + now = GNUNET_TIME_absolute_get (); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Trying to claim shard %llu-%llu\n", (unsigned long long) *start_row, |