+
+@shared_task
+def index_picture(picture_id, picture_info=None, **kwargs):
+ from picture.models import Picture
+ try:
+ return Picture.objects.get(id=picture_id).search_index(picture_info, **kwargs)
+ except Exception as e:
+ print("Exception during index: %s" % e)
+ print_exc()
+ raise e