0

I have implemented Celery task that downloads imagefile from web and stores the imagefile with metadata into the database.
Actually, I'm using Django ImageFieldModel so that the metadata is stored in the database and file is stored in the Azure Blob Storage.

It is working well in demo environment. Imagefile is stored in filesystem which is same physical location with a worker.

However, it has a problem in deployment environment. The file storage is Azure Blob Storage.

Sometimes, Imagefile is not stored. Metadata is sorted in database.

Does anybody know why this happens.

How I store the imagefile is really simple.

new_contents = ImageContents(user = user, privacy = privacy)

new_contents.thumb_file.save('filename.jpeg', thumb_file, save = True)

new_contents.save()

I have implemented django-storage for Azure Blob Storage.

This is code that opens the file in django app:

  def _open(self, name, mode='rb'):

    inMemFile = StringIO.StringIO(self.blob.get_blob(self.container, name))
    inMemFile.name = name
    inMemFile.mode = mode

    return File(inMemFile)
GileBrt
  • 1,830
  • 3
  • 20
  • 28
shchoi
  • 23
  • 1
  • 5
  • Can you show us the code you're using to interact with blob storage? – user94559 Sep 21 '12 at 18:26
  • I updated code that open file from azure blob. It is part of django-files that i implemented – shchoi Sep 22 '12 at 06:05
  • That code looks like it's what *reads* from blob storage, but the issue you're having is that sometimes the *write* isn't happening, right? Can we see the code that's writing to blob storage? What debugging have you done so far to isolate the problem? – user94559 Sep 22 '12 at 11:43

0 Answers0