Skip to content

Commit

Permalink
Add logger info on redis connection
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Apr 25, 2024
1 parent 95e46b6 commit c060cfa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def create(self, validated_data):
validated_data["created_by"] = user
# create the model instance
instance = Training.objects.create(**validated_data)

logging.info("Sending record to redis queue")
# run your function here
task = train_model.delay(
dataset_id=instance.model.dataset.id,
Expand All @@ -139,6 +139,8 @@ def create(self, validated_data):
or instance.model.dataset.source_imagery,
freeze_layers=instance.freeze_layers,
)
logging.info("Record saved in queue")

if not instance.source_imagery:
instance.source_imagery = instance.model.dataset.source_imagery
instance.task_id = task.id
Expand Down

0 comments on commit c060cfa

Please sign in to comment.