Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ricecooker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ def setup_logging(level=logging.INFO, main_log=None, error_log=None, add_loggers
else False
)

GOOGLE_SERVICE_ACCOUNT_CREDENTIALS_PATH = os.getenv(
"GOOGLE_SERVICE_ACCOUNT_CREDENTIALS_PATH", None
)

if GOOGLE_SERVICE_ACCOUNT_CREDENTIALS_PATH:
TASK_THREADS = 1 # If using service account, only one thread is allowed - random errors happen otherwise.

# CSV headers
CSV_HEADERS = [
"Source ID",
Expand Down
7 changes: 7 additions & 0 deletions ricecooker/utils/pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import mimetypes
import os
from copy import deepcopy
from typing import Dict
from typing import Optional
Expand All @@ -9,6 +11,11 @@
from ricecooker.utils.pipeline.context import FileMetadata


# Do this to prevent import of broken Windows filetype registry that makes guesstype not work.
# https://www.thecodingforums.com/threads/mimetypes-guess_type-broken-in-windows-on-py2-7-and-python-3-x.952693/
mimetypes.init([os.path.abspath(os.path.join(os.path.dirname(__file__), "mime.types"))])


class FilePipeline(CompositeHandler):
"""
A class to manage a sequence of handlers and execute them in order.
Expand Down
Loading
Loading