Skip to content

Commit

Permalink
Close the tar file
Browse files Browse the repository at this point in the history
  • Loading branch information
rsh7 committed Aug 12, 2018
1 parent 0a43c08 commit 0566d77
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions db/data.py
Expand Up @@ -10,6 +10,7 @@

from sqlalchemy import text
import sqlalchemy.exc
from brainzutils import musicbrainz_db

_whitelist_file = os.path.join(os.path.dirname(__file__), "tagwhitelist.json")
_whitelist_tags = set(json.load(open(_whitelist_file)))
Expand Down
2 changes: 1 addition & 1 deletion manage.py
Expand Up @@ -202,7 +202,7 @@ def get_entities():
print('Redirecting mbids to original entities...')
webserver.external.get_entities.get_original_entity()


@cli.command()
def apply_replication_changes():
print("\nUpdating musicbrainz schema by applying replication packets...")
musicbrainz_importer.apply_replication_changes.main()
Expand Down
2 changes: 2 additions & 0 deletions musicbrainz_importer/apply_replication_changes.py
Expand Up @@ -36,6 +36,7 @@
from sqlalchemy import text
from sqlalchemy.exc import IntegrityError
import db.import_mb_data
import db.data

include_tables = ['language', 'artist_credit_name', 'artist', 'artist_gid_redirect', 'area', 'area_type', 'recording_gid_redirect', \
'script', 'release_gid_redirect', 'recording', 'track', 'artist_credit', 'release_group_primary_type', 'release_group', \
Expand Down Expand Up @@ -298,6 +299,7 @@ def process_tar(fileobj, expected_schema_seq, replication_seq):
elif member.name in ('mbdump/PendingData', 'mbdump/dbmirror_pendingdata'):
importer.load_pending_data(tar.extractfile(member))
importer.process()
tar.close()


def download_packet(base_url, token, replication_seq):
Expand Down

0 comments on commit 0566d77

Please sign in to comment.