FinalsClub / djKarma

GNU General Public License v3.0
9 stars 1 forks source link

Uploaded Files UNsaving fields after upload #185

Open sethwoodworth opened 11 years ago

sethwoodworth commented 11 years ago

I think that this is a race condition in the File() model object

  1. The File() is created via ajaxuploader and given only an id and a file field
  2. Metadata is saved on form submission
  3. convert_with_gdrive() via celery uploads the file, and saves the .text and .html to the file obj

What I think is happening is celery kicks off the convert job right after ajaxuploader is complete. It contains a File() object that doesn't contain title metadata. The flow looks like this:

  1. ajaxuploader creates File.id = 1 and saves
  2. celery queries File.id=1 and it has no metadata
  3. FileMeta saves title and description to File.id=1
  4. celery finishes uploading and downloading the file, appens .text and .html to the File object, and saves an otherwise blank file to the DB

File.update() may fix this

sethwoodworth commented 11 years ago

Crisis averted. I managed to patch this in de6af147. Deployment requires restarting celery and I have not yet doneso to beta, but I had not yet noticed this issue on beta. Either way, scary bug

sethwoodworth commented 11 years ago

Please test