diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-05-24 10:45:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-05-24 10:45:01 +0200 |
commit | 8e71a7e4de8c07767e8e11e745d9a7fc3bacc94f (patch) | |
tree | 9580279a327354eff572e25e4e5e901b18b428e5 /src/exchangedb | |
parent | 92e04e0a3f31a9407b3f8e6e8f615000a57c726f (diff) | |
download | exchange-8e71a7e4de8c07767e8e11e745d9a7fc3bacc94f.tar.xz |
lock into the future, instead of lock into past
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 3ea6b97ae..5924c9bfe 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -12929,8 +12929,7 @@ postgres_begin_shard (void *cls, GNUNET_PQ_result_spec_end }; - past = GNUNET_TIME_absolute_subtract (GNUNET_TIME_absolute_get (), - delay); + past = GNUNET_TIME_absolute_get (); qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "get_open_shard", params, @@ -12956,7 +12955,8 @@ postgres_begin_shard (void *cls, GNUNET_PQ_query_param_end }; - now = GNUNET_TIME_timestamp_get (); + now = GNUNET_TIME_absolute_to_timestamp ( + GNUNET_TIME_relative_to_absolute (delay)); qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, "reclaim_shard", params); @@ -13030,9 +13030,10 @@ postgres_begin_shard (void *cls, GNUNET_PQ_query_param_end }; - now = GNUNET_TIME_timestamp_get (); + now = GNUNET_TIME_absolute_to_timestamp ( + GNUNET_TIME_relative_to_absolute (delay)); GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Trying to claim shard %llu-%llu\n", + "Trying to claim shard (%llu-%llu]\n", (unsigned long long) *start_row, (unsigned long long) *end_row); qs = GNUNET_PQ_eval_prepared_non_select (pg->conn, |