mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-28 13:42:36 +01:00
Fixed some exception handling madealios.
This commit is contained in:
parent
601ea799f3
commit
eadfd7141b
@ -292,12 +292,12 @@ class PeriodicFileDownloader(object):
|
||||
self.getFile(filename)
|
||||
|
||||
def _downloadFile(self, filename, url, f):
|
||||
self.currentlyDownloading.add(filename)
|
||||
try:
|
||||
try:
|
||||
infd = urllib2.urlopen(url)
|
||||
infd = webutils.getUrlFd(url)
|
||||
except IOError, e:
|
||||
self.log.warning('Error downloading %s', url)
|
||||
self.log.exception('Exception:')
|
||||
self.log.warning('Error downloading %s: %s', url, e)
|
||||
return
|
||||
confDir = conf.supybot.directories.data()
|
||||
newFilename = os.path.join(confDir, utils.mktemp())
|
||||
@ -334,7 +334,6 @@ class PeriodicFileDownloader(object):
|
||||
if time.time() - self.lastDownloaded[filename] > timeLimit and \
|
||||
filename not in self.currentlyDownloading:
|
||||
self.log.info('Beginning download of %s', url)
|
||||
self.currentlyDownloading.add(filename)
|
||||
args = (filename, url, f)
|
||||
name = '%s #%s' % (filename, self.downloadedCounter[filename])
|
||||
t = threading.Thread(target=self._downloadFile, name=name,
|
||||
|
Loading…
Reference in New Issue
Block a user