return function(cb) {
    total++;
    new models.Resource({
      path: resourcePath,
      mimeType: MIME_TYPES[path.extname(localPath)],