Scan files with clamdscan #77
@ -13,7 +13,7 @@ logger = logging.getLogger(__name__)
|
|||||||
|
|
||||||
@background(schedule={'action': TaskSchedule.RESCHEDULE_EXISTING})
|
@background(schedule={'action': TaskSchedule.RESCHEDULE_EXISTING})
|
||||||
def scan(file_id: int):
|
def scan(file_id: int):
|
||||||
"""Run a scan on a given file and save its output as a FileValidation record."""
|
"""Run a scan of a given file and save its output as a FileValidation record."""
|
||||||
file = files.models.File.objects.get(pk=file_id)
|
file = files.models.File.objects.get(pk=file_id)
|
||||||
abs_path = os.path.join(settings.MEDIA_ROOT, file.source.path)
|
abs_path = os.path.join(settings.MEDIA_ROOT, file.source.path)
|
||||||
completed_process = files.utils.run_clamdscan(abs_path)
|
completed_process = files.utils.run_clamdscan(abs_path)
|
||||||
|
Loading…
Reference in New Issue
Block a user