def demo_sleep(download_id, howlong=5, expiry=1 * 60 * 60): """ Demo the downloader, with sleep """ time.sleep(howlong) temp_id = uuid.uuid4().hex cache.set(temp_id, "It works!", expiry) cache.set(download_id, CachedDownload(temp_id), expiry)
def bulk_upload_async(download_id, domain, user_specs, group_specs): results = create_or_update_users_and_groups(domain, user_specs, group_specs) temp_id = uuid.uuid4().hex expiry = 60 * 60 cache.set(temp_id, results, expiry) cache.set( download_id, CachedDownload(temp_id, content_disposition="", mimetype="text/html"), expiry)