Skip to content

Commit

Permalink
sources/storage.h: add storage link into watchdog
Browse files Browse the repository at this point in the history
To use it later

Signed-off-by: rkhapov <[email protected]>
  • Loading branch information
rkhapov committed Jan 28, 2025
1 parent 6b2031e commit 11defa5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions sources/config_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,7 @@ static int od_config_reader_storage(od_config_reader_t *reader,
extensions) ==
NOT_OK_RESPONSE)
goto error;
storage->watchdog->storage = storage;
continue;
default: {
od_config_reader_error(reader, &token,
Expand Down
5 changes: 3 additions & 2 deletions sources/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,12 @@ void od_storage_watchdog_watch(void *arg)
od_instance_t *instance = global->instance;

od_debug(&instance->logger, "watchdog", NULL, NULL,
"start lag polling watchdog");
"start watchdog for storage '%s'", watchdog->storage->name);

od_storage_watchdog_do_polling_loop(watchdog);

od_debug(&instance->logger, "watchdog", NULL, NULL,
"deallocating storage watchdog");
"deallocating watchdog for storage '%s'",
watchdog->storage->name);
od_storage_watchdog_free(watchdog);
}
2 changes: 2 additions & 0 deletions sources/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ struct od_storage_watchdog {
int online;

od_global_t *global;

od_rule_storage_t *storage;
};

od_storage_watchdog_t *od_storage_watchdog_allocate(od_global_t *);
Expand Down

0 comments on commit 11defa5

Please sign in to comment.