Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude related_observables_count from model_dump_json in save method #1134

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

udgover
Copy link
Collaborator

@udgover udgover commented Sep 9, 2024

This PR fixes a performance issue when saving entities. This was introduced with Entity.related_observables_count computed field which is called each time an entity is saved. This means at each save call, neighbors method was also called. This mainly impacts feeds or tasks creating / updating lots of entities.

Fixing this issue relies on excluding related_observables_count when calling model_json_dump in ArangoDatabase.save method.

@sebdraven sebdraven merged commit 5ea0d60 into main Sep 10, 2024
3 checks passed
@sebdraven sebdraven deleted the fix_related_observables_count branch September 10, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants