mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
(fix): filter Usage hook to only handle create/delete events, not reads
This commit is contained in:
1 parent
bc1c1718b8
commit
1f5ac9e323
1 file changed
+7
-2
@@ -28,13 +28,18 @@ class Usage implements Lifecycle
|
||||
}
|
||||
|
||||
$value = match ($event) {
|
||||
Event::DocumentCreate => 1,
|
||||
Event::DocumentDelete => -1,
|
||||
Event::DocumentsDelete => -1 * $data->getAttribute('modified', 0),
|
||||
Event::DocumentsCreate => $data->getAttribute('modified', 0),
|
||||
Event::DocumentsDelete => -1 * $data->getAttribute('modified', 0),
|
||||
Event::DocumentsUpsert => $data->getAttribute('created', 0),
|
||||
default => 1,
|
||||
default => null,
|
||||
};
|
||||
|
||||
if ($value === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
$collection = $data->getCollection();
|
||||
|
||||
match (true) {
|
||||
|
||||
Reference in new issue
Block a user