Commit cdd84790 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

wip(backend): node data cache timeout

parent 54523a60
......@@ -705,10 +705,12 @@ sub _data($self, $field, $value=undef) {
}
sub _timed_data_cache($self) {
return if time - $self->{$FIELD_TIMEOUT} < $CACHE_TIMEOUT;
return if !$self->{$FIELD_TIMEOUT} || time - $self->{$FIELD_TIMEOUT} < $CACHE_TIMEOUT;
warn "$$ deleting cache node ".localtime(time);
my $name = $self->{_data}->{name};
my $id = $self->{_data}->{id};
delete $self->{_data};
delete $self->{$FIELD_TIMEOUT};
$self->{_data}->{name} = $name if $name;
$self->{_data}->{id} = $id if $id;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment