add: database functions and generalisation
This commit is contained in:
parent
7c6eed8dc2
commit
14c35a4227
8 changed files with 193 additions and 149 deletions
src
|
@ -169,11 +169,10 @@ cache_invalidate_relay(int relay_id)
|
|||
sprintf(key, "relay_json:%d", relay_id);
|
||||
cache_invalidate(key);
|
||||
|
||||
relay_t *relay = relay_get_by_id(relay_id);
|
||||
if(relay)
|
||||
int controller_id = relay_get_controller_id_for_relay(relay_id);
|
||||
if(controller_id)
|
||||
{
|
||||
cache_invalidate_controller(relay->controller_id);
|
||||
relay_free(relay);
|
||||
cache_invalidate_controller(controller_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue