Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
eb761f06
Commit
eb761f06
authored
Feb 02, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timeout connections to s3 after 1 minute, to avoid errors later
parent
147a2b67
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
fs/s3fs.py
+10
-4
No files found.
fs/s3fs.py
View file @
eb761f06
...
...
@@ -120,16 +120,22 @@ class S3FS(FS):
def
_s3conn
(
self
):
try
:
return
self
.
_tlocal
.
s3conn
(
c
,
ctime
)
=
self
.
_tlocal
.
s3conn
if
time
.
time
()
-
ctime
>
60
:
raise
AttributeError
return
c
except
AttributeError
:
c
=
boto
.
s3
.
connection
.
S3Connection
(
*
self
.
_access_keys
)
self
.
_tlocal
.
s3conn
=
c
self
.
_tlocal
.
s3conn
=
(
c
,
time
.
time
())
return
c
_s3conn
=
property
(
_s3conn
)
def
_s3bukt
(
self
):
try
:
return
self
.
_tlocal
.
s3bukt
(
b
,
ctime
)
=
self
.
_tlocal
.
s3bukt
if
time
.
time
()
-
ctime
>
60
:
raise
AttributeError
return
b
except
AttributeError
:
try
:
b
=
self
.
_s3conn
.
get_bucket
(
self
.
_bucket_name
,
validate
=
True
)
...
...
@@ -137,7 +143,7 @@ class S3FS(FS):
if
"404 Not Found"
not
in
str
(
e
):
raise
b
=
self
.
_s3conn
.
create_bucket
(
self
.
_bucket_name
)
self
.
_tlocal
.
s3bukt
=
b
self
.
_tlocal
.
s3bukt
=
(
b
,
time
.
time
())
return
b
_s3bukt
=
property
(
_s3bukt
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment