Update virus scan

This commit is contained in:
Devoalda 2023-10-31 18:14:21 +08:00
parent c3581e091e
commit 6b59bc2c28
3 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,8 @@ argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
asgiref==3.7.2
boto==2.49.0
boto3==1.28.74
botocore==1.31.74
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.2.0
@ -22,6 +24,7 @@ inflect==7.0.0
inflection==0.5.1
install==1.3.5
isort==5.12.0
jmespath==1.0.1
mysqlclient==2.2.0
packaging==23.2
protobuf==4.24.4
@ -31,11 +34,15 @@ pydantic==2.4.2
pydantic_core==2.10.1
PyJWT==1.7.1
PyMySQL==1.1.0
python-dateutil==2.8.2
python-environ==0.4.54
python-magic==0.4.27
pytz==2023.3.post1
PyYAML==6.0.1
redis==5.0.1
requests==2.31.0
s3transfer==0.7.0
six==1.16.0
sqlparse==0.4.4
typing_extensions==4.8.0
uritemplate==4.1.1

View File

@ -5,7 +5,7 @@ import dynamo_pb2_grpc as pb2_grpc
class Client:
def __init__(self):
self.channel = grpc.insecure_channel("http://safeshare-virus:50051")
self.channel = grpc.insecure_channel("localhost:50051")
self.stub = pb2_grpc.Dynamo_DBStub(self.channel)
def CheckFile(self, sha_256_id: str):

View File

@ -80,8 +80,10 @@ class ManageItemsView(APIView):
try:
grpc_client = client.Client()
result = grpc_client.CheckFile(hash_signature, timeout=10)
print(f'Checking file {filename} with hash signature {hash_signature}')
result = grpc_client.CheckFile(hash_signature)
except Exception as e:
print(f'Error checking file: {str(e)}')
result = False
if result: