Skip to content

Commit

Permalink
feat: explicit garbage collection after scan
Browse files Browse the repository at this point in the history
  • Loading branch information
dervoeti committed Nov 18, 2024
1 parent 9c2c2f3 commit e39ea18
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gc
import os
from dataclasses import dataclass
from typing import Optional, Tuple
Expand Down Expand Up @@ -176,6 +177,11 @@ def file_upload_observations(
vulnerability_check.last_import_licenses_deleted = None
vulnerability_check.save()

del vulnerability_check
del import_parameters
del data
gc.collect()

return (
numbers_observations[0],
numbers_observations[1],
Expand Down Expand Up @@ -237,6 +243,11 @@ def api_import_observations(
},
)

del imported_observations
del import_parameters
del data
gc.collect()

return numbers[0], numbers[1], numbers[2]


Expand Down

0 comments on commit e39ea18

Please sign in to comment.