mirror of
https://github.com/EDCD/EDDN.git
synced 2025-06-14 14:22:18 +03:00
Rewrite schemas during transition period
This commit is contained in:
parent
a959390ff7
commit
04a8f91b8c
@ -37,6 +37,11 @@ statsCollector = StatsCollector()
|
|||||||
statsCollector.start()
|
statsCollector.start()
|
||||||
|
|
||||||
|
|
||||||
|
# Migration from schemas.elite-markets.net to eddn.edcd.io - Remove after transition complete!
|
||||||
|
import re
|
||||||
|
TRANSITION_RE = re.compile('^https://eddn.edcd.io/schemas/(.+)')
|
||||||
|
|
||||||
|
|
||||||
def configure():
|
def configure():
|
||||||
# Get the list of transports to bind from settings. This allows us to PUB
|
# Get the list of transports to bind from settings. This allows us to PUB
|
||||||
# messages to multiple announcers over a variety of socket types
|
# messages to multiple announcers over a variety of socket types
|
||||||
@ -145,6 +150,11 @@ def parse_and_error_handle(data):
|
|||||||
if validationResults.severity <= ValidationSeverity.WARN:
|
if validationResults.severity <= ValidationSeverity.WARN:
|
||||||
parsed_message['header']['gatewayTimestamp'] = datetime.utcnow().isoformat() + 'Z'
|
parsed_message['header']['gatewayTimestamp'] = datetime.utcnow().isoformat() + 'Z'
|
||||||
|
|
||||||
|
# Migration from schemas.elite-markets.net to eddn.edcd.io - Remove after transition complete!
|
||||||
|
match = TRANSITION_RE.match(parsed_message['$schemaRef'])
|
||||||
|
if match and match.group(1):
|
||||||
|
parsed_message['$schemaRef'] = 'http://schemas.elite-markets.net/eddn/%s' % match.group(1)
|
||||||
|
|
||||||
ip_hash_salt = Settings.GATEWAY_IP_KEY_SALT
|
ip_hash_salt = Settings.GATEWAY_IP_KEY_SALT
|
||||||
if ip_hash_salt:
|
if ip_hash_salt:
|
||||||
# If an IP hash is set, salt+hash the uploader's IP address and set
|
# If an IP hash is set, salt+hash the uploader's IP address and set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user