Fixed chart's last accessed time during context queries (#9952)

This commit is contained in:
Stelios Fragkakis 2020-09-18 23:45:23 +03:00 committed by GitHub
parent 718d8872cb
commit 8194ac83f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -141,7 +141,8 @@ int rrdset2anything_api_v1(
, time_t *latest_timestamp
, char *context
) {
st->last_accessed_time = now_realtime_sec();
time_t last_accessed_time = now_realtime_sec();
st->last_accessed_time = last_accessed_time;
RRDDIM *temp_rd = NULL;
@ -153,6 +154,7 @@ int rrdset2anything_api_v1(
// Loop the dimensions of the chart
RRDDIM *rd1;
rrdset_rdlock(st1);
st1->last_accessed_time = last_accessed_time;
rrddim_foreach_read(rd1, st1) {
RRDDIM *rd = mallocz(rd1->memsize);
memcpy(rd, rd1, rd1->memsize);