Skip to content

Photo upload refactor - #2733

Open
symroe wants to merge 12 commits into
masterfrom
photo-upload-refactor
Open

symroe wants to merge 12 commits into
masterfrom
photo-upload-refactor

Conversation

@symroe

@symroe symroe commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

Move photo resizing and face detection to tasks.

I've used async_chain to split these up into two tasks, in case lumping them into one might case time outs or other issues.


@symroe
symroe force-pushed the photo-upload-refactor branch 3 times, most recently from 1b08090 to 597b264 Compare April 23, 2026 15:26
@symroe
symroe marked this pull request as ready for review April 23, 2026 15:27
@symroe
symroe requested a review from chris48s April 23, 2026 15:27

@chris48s chris48s left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not tried running this locally yet, but here's a few quick comments based on a scan over the diff

Comment thread ynr/apps/moderation_queue/models.py Outdated
Comment thread ynr/apps/moderation_queue/models.py Outdated
def start_image_processing(self):
from django_q.tasks import async_chain

async_chain(

@chris48s chris48s Apr 27, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to explicitly set a timeout on these two tasks. Our default timeout for the cluster is 240 seconds. We need this to be quite long for our scheduled tasks which are processing many objects in a single run, but we should set a shorter timeout on these jobs that are only processing a single object.

Also a quick note on retries: Our cluster is set not to retry failed tasks. We basically need that to be true at the moment with all the tasks we have running on a short loop. We can't configure this at a task level, so if this fails once, it won't retry. I don't think that is a huge issue, but worth being aware of. Once we have fewer scheduled tasks running frequently, we can look at changing that. I think as it stands this is no worse than what we do now.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this still stands

Comment thread ynr/apps/moderation_queue/helpers.py Outdated
Comment thread ynr/apps/moderation_queue/models.py Outdated
Comment thread ynr/apps/moderation_queue/helpers.py Outdated
@symroe
symroe force-pushed the photo-upload-refactor branch from 4b10091 to 2086bdf Compare September 28, 2026 11:52
@chris48s

chris48s commented Oct 1, 2026

Copy link
Copy Markdown
Member

OK, so I've had another look over this.

Looks like all the original comments are addressed.

You have a failing build, but I think it is just a ruff error that can be autofixed. Can you have a look at that.

Aside from that, I think this is probably good to go, but I'll leave you to think about whether to deploy it now or leave it in case it throws up any issues during time we're supposedly leaving clear.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants