Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
NSW Rural Fire Service platform #16802
This is a new platform in the geo location component. It retrieves information about bushfires from the NSW Rural Fire Service. The platform supports two filters: The common radius filter which lets users define a radius around their home so that only events occurring within that radius are included. Also, users can select one or more categories ('Emergency Warning', 'Watch and Act', 'Advice', 'Not Applicable') that they are interested in only.
Related issue (if applicable): evolving #15953
Example entry for
I think we can make the code more clear and efficient by taking more advantage of the uniqueness property of the
external_id. We can use a
set to store these representing existing entities. We can store the incoming feed entries as a dict with external_id as key. And we use our dispatch helper to signal the correct entities.
Then on update its very easy to match existing external_ids (entities) with incoming entries ids since sets support intersection and difference operations. We just create a temporary set from the incoming external_ids and compare this with existing external_ids.
Existing external_ids not in incoming external_ids should be removed (those entities should be signaled to be removed). Existing external_ids present in incoming external_ids should be updated (those entities should be signaled to be updated). Incoming external_ids not in existing external_ids should be used to create new entities.
This suggestion goes beyond what I've commented on below.