diff --git a/safeshare/docker-compose.yml b/safeshare/docker-compose.yml index b38a5cb..72fed57 100644 --- a/safeshare/docker-compose.yml +++ b/safeshare/docker-compose.yml @@ -19,7 +19,7 @@ services: ports: - "8000:8000" # Map container port 8000 to host port 8000 environment: - - DEBUG=FALSE + - DEBUG=True - SECRET_KEY=A_RANDOM_SECRET_KEY - ALLOWED_HOSTS=* - CACHE=True @@ -27,6 +27,7 @@ services: - REDIS_PORT=6379 - REDIS_DB=0 - TRASH_TIMEOUT=60 + - DJANGO_LOG_LEVEL=INFO depends_on: - redis networks: diff --git a/safeshare/safeshare/urls.py b/safeshare/safeshare/urls.py index 65138e0..4d3b693 100644 --- a/safeshare/safeshare/urls.py +++ b/safeshare/safeshare/urls.py @@ -16,8 +16,6 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include -from safeshare_app.utils.TrashCollector import TrashCollector -import threading urlpatterns = [ diff --git a/safeshare/safeshare_app/utils/safeshare_vdb_client/client.py b/safeshare/safeshare_app/utils/safeshare_vdb_client/client.py index 78c0832..0d49a1f 100644 --- a/safeshare/safeshare_app/utils/safeshare_vdb_client/client.py +++ b/safeshare/safeshare_app/utils/safeshare_vdb_client/client.py @@ -9,10 +9,12 @@ class Client: self.stub = pb2_grpc.Dynamo_DBStub(self.channel) def CheckFile(self, sha_256_id: str): + print(f"Checking file {sha_256_id} with hash signature {sha_256_id}") response = self.stub.CheckHash(pb2.Request(file_hash=sha_256_id)) return response.is_exist def UpdateFile(self, sha_256_id: str): + print(f"Updating file {sha_256_id} with hash signature {sha_256_id}") response = self.stub.UpdateHash(pb2.Request(file_hash=sha_256_id)) return response.is_exist diff --git a/safeshare/safeshare_app/views/file.py b/safeshare/safeshare_app/views/file.py index 011ec70..0f103f9 100644 --- a/safeshare/safeshare_app/views/file.py +++ b/safeshare/safeshare_app/views/file.py @@ -22,7 +22,7 @@ logger = logging.getLogger(__name__) class ManageItemsView(APIView): - TIMEOUT = 5 + TIMEOUT = 20 # seconds def post(self, request): files = request.FILES.getlist('file') @@ -80,7 +80,7 @@ class ManageItemsView(APIView): try: grpc_client = client.Client() - result = grpc_client.CheckFile(hash_signature) + result = grpc_client.CheckFile(hash_signature, timeout=10) except Exception as e: result = False