summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-07-26 16:10:31 +0300
committerGitHub <noreply@github.com>2023-07-26 16:10:31 +0300
commit6daedef25bff12f39d46c582ea1010ebcac95329 (patch)
tree7553cca695b3ed63450078c49775702f117ee6a1 /database
parent33cdac2f68b724483725d364d6ed0980a9bb2078 (diff)
fix expiration dates for API responses (#15546)
Diffstat (limited to 'database')
-rw-r--r--database/contexts/query_target.c2
-rw-r--r--database/contexts/rrdcontext.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/database/contexts/query_target.c b/database/contexts/query_target.c
index e2e36a11ea..0c08dffd70 100644
--- a/database/contexts/query_target.c
+++ b/database/contexts/query_target.c
@@ -1052,7 +1052,7 @@ QUERY_TARGET *query_target_create(QUERY_TARGET_REQUEST *qtr) {
if(query_target_has_percentage_of_group(qt))
qt->window.options &= ~RRDR_OPTION_PERCENTAGE;
- rrdr_relative_window_to_absolute(&qt->window.after, &qt->window.before, &qt->window.now);
+ qt->internal.relative = rrdr_relative_window_to_absolute(&qt->window.after, &qt->window.before, &qt->window.now);
// prepare our local variables - we need these across all these functions
QUERY_TARGET_LOCALS qtl = {
diff --git a/database/contexts/rrdcontext.h b/database/contexts/rrdcontext.h
index 829a4f2b33..7c0c156737 100644
--- a/database/contexts/rrdcontext.h
+++ b/database/contexts/rrdcontext.h
@@ -409,6 +409,7 @@ typedef struct query_target {
struct {
SPINLOCK spinlock;
bool used; // when true, this query is currently being used
+ bool relative; // when true, this query uses relative timestamps
size_t queries; // how many query we have done so far with this QUERY_TARGET - not related to database queries
struct query_target *prev;
struct query_target *next;