code: def item_post_save_async(uuid, download=True):
      items = Item.objects.filter(uuid=uuid)
      # arbitrary sleep ensuring the item.save() is already done
      while not items:
          items = Item.objects.filter(uuid=uuid)
          time.sleep(0.5)
      items.update(lock=True)
      item = items[0]
  
      if not item.source_file:
          if item.external_id:
              source_file = item.get_source_from_id(download=download)
          elif item.external_uri:
              source_file = item.get_source_from_uri(download=download)
          else:
              source_file = ""
          items.update(
              source_file=source_file.replace(settings.MEDIA_ROOT, "")
          )
          item = Item.objects.get(uuid=uuid)
  
      if item.source_file:
          sha1 = item.get_hash()
          mime_type = item.get_mime_type()
          audio_duration = item.get_audio_duration()
          samplerate = item.get_audio_samplerate()
          items.update(
              sha1=sha1,
              mime_type=mime_type,
              audio_duration=audio_duration,
              samplerate=samplerate,
          )
          item.process_waveform()
  
      items.update(lock=False)
  
file_path: TimeSide/timeside/server/tasks.py
imports: from __future__ import absolute_import
  import time
  import gc
  from celery import shared_task
  from celery.result import AsyncResult
  from celery.result import GroupResult
  from .models import Item, Selection, Preset, Experience, Task
  from .models import _DONE
  from celery.task import chord
  from celery.utils.log import get_task_logger
  from django.conf import settings
  import redis
label_desc: Use image node_id 4 for calling a global function with example usage: item_post_save_async(uuid, download) without return types