mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-12 02:52:20 -05:00
Merge pull request #1287 from abeloin/patch-unraid_link
Added detection of fs not implemented link creation
This commit is contained in:
commit
a086193fe2
@ -58,7 +58,11 @@ class CacheControlAdapter(HTTPAdapter):
|
||||
response = cached_response
|
||||
else:
|
||||
# try to cache the response
|
||||
self.controller.cache_response(request, response)
|
||||
try:
|
||||
self.controller.cache_response(request, response)
|
||||
except Exception as e:
|
||||
# Failed to cache the results
|
||||
pass
|
||||
|
||||
resp = super(CacheControlAdapter, self).build_response(
|
||||
request, response
|
||||
|
@ -5,6 +5,7 @@ import os
|
||||
|
||||
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
|
||||
AlreadyLocked)
|
||||
import errno
|
||||
|
||||
class LinkLockFile(LockBase):
|
||||
"""Lock access to a file using atomic property of link(2).
|
||||
@ -28,7 +29,9 @@ class LinkLockFile(LockBase):
|
||||
# Try and create a hard link to it.
|
||||
try:
|
||||
os.link(self.unique_name, self.lock_file)
|
||||
except OSError:
|
||||
except OSError as e:
|
||||
if e.errno == errno.ENOSYS:
|
||||
raise LockFailed("%s" % e.strerror)
|
||||
# Link creation failed. Maybe we've double-locked?
|
||||
nlinks = os.stat(self.unique_name).st_nlink
|
||||
if nlinks == 2:
|
||||
|
Loading…
Reference in New Issue
Block a user