| Index: gae/file_reader.py
|
| diff --git a/gae/file_reader.py b/gae/file_reader.py
|
| index a0c92903503f768705160ae001cdde903f85ef2d..e701cb557472d5a97109e57923eefeee178aec4a 100644
|
| --- a/gae/file_reader.py
|
| +++ b/gae/file_reader.py
|
| @@ -2,7 +2,7 @@
|
| # Use of this source code is governed by a BSD-style license that can be
|
| # found in the LICENSE file.
|
|
|
| -from google.appengine.api import files
|
| +import cloudstorage
|
| import logging
|
| import traceback
|
|
|
| @@ -14,13 +14,12 @@ def read(config_helper, file_name):
|
| return content
|
| # Sometimes remote calls fail for different reasons. Make sure we retry.
|
| full_path = config_helper.get_full_path(file_name)
|
| - for _ in [1, 2, 3]:
|
| - try:
|
| - with files.open(full_path, 'r') as stream:
|
| - content = stream.read()
|
| - cache.set_content(file_name, content)
|
| - return content
|
| - except:
|
| - logging.error('Full path: %s' % full_path)
|
| - logging.error(traceback.format_exc())
|
| + try:
|
| + with cloudstorage.open(full_path, 'r') as stream:
|
| + content = stream.read()
|
| + cache.set_content(file_name, content)
|
| + return content
|
| + except:
|
| + logging.error('Full path: %s' % full_path)
|
| + logging.error(traceback.format_exc())
|
| return None
|
|
|