Skip to content

Commit

Permalink
Fix #186 - Do not delete existing data for non-NRTM when serial is to…
Browse files Browse the repository at this point in the history
…o recent
  • Loading branch information
mxsasha committed Feb 1, 2019
1 parent 7f76d5d commit cc0b8ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion irrd/mirroring/mirror_runners_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def run(self, database_handler: DatabaseHandler, serial_newest_seen: Optional[in
logger.info(f'Skipping full import for {self.source}, import_source not set.')
return

database_handler.delete_all_rpsl_objects_with_journal(self.source)
logger.info(f'Running full import of {self.source} from {import_sources}, serial from {import_serial_source}')

import_serial = None
Expand All @@ -97,6 +96,7 @@ def run(self, database_handler: DatabaseHandler, serial_newest_seen: Optional[in
f'{serial_newest_seen}, import_serial is {import_serial}, cancelling import.')
return

database_handler.delete_all_rpsl_objects_with_journal(self.source)
import_data = [self._retrieve_file(import_source, return_contents=False) for import_source in import_sources]

database_handler.disable_journaling()
Expand Down
2 changes: 1 addition & 1 deletion irrd/mirroring/tests/test_mirror_runners_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def test_import_cancelled_serial_too_old(self, monkeypatch, config_override, cap
MirrorFullImportRunner('TEST').run(mock_dh, serial_newest_seen=424243)

assert not MockMirrorFileImportParser.rpsl_data_calls
assert not mock_dh.call_count
assert flatten_mock_calls(mock_dh) == []
assert 'Current newest serial seen for TEST is 424243, import_serial is 424242, cancelling import.'

def test_import_force_reload_with_serial_too_old(self, monkeypatch, config_override):
Expand Down

0 comments on commit cc0b8ea

Please sign in to comment.