Skip to content

Commit

Permalink
Explicitly import S3 module to initialize S3Uploader and MinIOUploade…
Browse files Browse the repository at this point in the history
…r in the global registry (#26)
  • Loading branch information
vbessonov authored Aug 25, 2021
1 parent c8cabd1 commit 18bdbd6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/odl2_import_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from webpub_manifest_parser.odl import ODLFeedParserFactory

from api.odl2 import ODL2API, ODL2Importer, ODL2ImportMonitor

# NOTE: We need to import it explicitly to initialize MirrorUploader.IMPLEMENTATION_REGISTRY
from core import s3
from core.opds2_import import RWPMManifestParser
from core.scripts import OPDSImportScript

Expand Down
5 changes: 5 additions & 0 deletions bin/odl_import_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
ODL collections."""
import os
import sys

bin_dir = os.path.split(__file__)[0]
package_dir = os.path.join(bin_dir, "..")
sys.path.append(os.path.abspath(package_dir))

# NOTE: We need to import it explicitly to initialize MirrorUploader.IMPLEMENTATION_REGISTRY
from core import s3
from scripts import ODLImportScript

ODLImportScript().run()
2 changes: 2 additions & 0 deletions bin/opds2_import_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ sys.path.append(os.path.abspath(package_dir))

from webpub_manifest_parser.opds2 import OPDS2FeedParserFactory

# NOTE: We need to import it explicitly to initialize MirrorUploader.IMPLEMENTATION_REGISTRY
from core import s3
from core.model import ExternalIntegration
from core.opds2_import import OPDS2Importer, OPDS2ImportMonitor, RWPMManifestParser
from core.scripts import OPDSImportScript
Expand Down
5 changes: 5 additions & 0 deletions bin/opds_import_monitor
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
OPDS import collections."""
import os
import sys

bin_dir = os.path.split(__file__)[0]
package_dir = os.path.join(bin_dir, "..")
sys.path.append(os.path.abspath(package_dir))

# NOTE: We need to import it explicitly to initialize MirrorUploader.IMPLEMENTATION_REGISTRY
from core import s3
from core.scripts import OPDSImportScript

OPDSImportScript().run()

0 comments on commit 18bdbd6

Please sign in to comment.