fix : edu 批量修改图片

This commit is contained in:
zty 2024-08-05 09:36:37 +08:00
parent 405eed0957
commit 3c1634b797
1 changed files with 8 additions and 2 deletions

View File

@ -150,8 +150,14 @@ class CertificateViewSet(CreateUpdateCustomMixin, ModelViewSet):
# Fetch the objects to update
Certificate.objects.filter(id__in=ids).update(**updates)
queryset = Certificate.objects.filter(id__in=ids)
thread = threading.Thread(target=make_img_x, args=(queryset,))
threads = []
for obj in queryset:
thread = threading.Thread(target=make_img_x, args=(obj,))
threads.append(thread)
thread.start()
for thread in threads:
thread.join()
# # Update the objects
# for obj in objects:
# # for field, value in updates.items():