def download_stop_handler(self, key): print '**** Download stopped. Going to handle it ...', key try: dl_info = Download.get(Download.key == key) dl_info.status = 'Finished' dl_info.save() except: print 'Problem in updating download info' del self.pool[key]