mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 20:48:21 +00:00
Make PUT on SQLite backend implicitly overwrite expired entries
The backend does not serve expired but still present entries so to a user they do not exist. When they put new data over such an entry their expecation is that the value is overwritten, even if not explicitly requested.
This commit is contained in:
parent
2f67539c0f
commit
16c40f4f3a
3 changed files with 52 additions and 21 deletions
|
@ -47,4 +47,15 @@ event zeek_init()
|
|||
# An expired value does not exist.
|
||||
get = Storage::Sync::get(h, key);
|
||||
print "AFTER", get;
|
||||
|
||||
# Even though the entry still exists in the backend we can put a
|
||||
# new value in its place without specifying overwrite.
|
||||
Storage::Sync::put(
|
||||
h,
|
||||
Storage::PutArgs(
|
||||
$key=key,
|
||||
$value=value+value));
|
||||
|
||||
get = Storage::Sync::get(h, key);
|
||||
print "OVERWRITE", get;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue