[openstreetmap/openstreetmap-website] [WIP] Trace import using ActiveJob (#2120)

Andy Allan notifications at github.com
Wed Jan 16 15:31:21 UTC 2019


Coming out of the conversations in #281 and #1852, I've started working on a mechanism to import and delete traces using the job queue, and avoiding the need for the [external gpx importer](https://github.com/openstreetmap/gpx-import) completely.

My first aim is to provide people with an option to import traces in development, by providing a configuration option to enable it, and fixing the icon creation to work again. This is what I've done so far, and I'm putting it up here for initial comments. It doesn't have any tests yet, hence the WIP label. But I think it could be merged as-is, since it's off by default and the icon methods have been broken for years anyway.

Beyond this stage, I would see the plan (in no particular order) as roughly:
* Write some tests to make sure this all works
* Get the animated gifs working (see https://github.com/dark-panda/gd2-ffij/issues/18)
* Get OSMF to set the option to false in the chef scripts, then flip the option to true in the defaults, so that the job queue works by default for new developers / other deployments
* Fix the importing to use [activerecord-import](https://github.com/zdennis/activerecord-import), to cut down the number of inserts per trace

OSMF can then switch off the external importer and use this one instead.

Initial thoughts/comments/etc welcome. Big thanks to @mmd-osm for investigating both gd2-ffij and activerecord-import
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/2120

-- Commit Summary --

  * Sketch out how to use the jobs queue for trace insertion and deletion
  * Add a configuration flag for using the job queue to import traces
  * Use gd-ffij gem to create trace icons

-- File Changes --

    M Gemfile (3)
    M Gemfile.lock (3)
    M app/controllers/traces_controller.rb (2)
    A app/jobs/application_job.rb (7)
    A app/jobs/trace_destroyer_job.rb (10)
    A app/jobs/trace_importer_job.rb (19)
    M config/example.application.yml (4)
    D lib/daemons/gpx_import.rb (59)
    D lib/daemons/gpx_import_ctl (23)
    M lib/gpx.rb (121)
    A test/jobs/trace_destroyer_job_test.rb (7)
    A test/jobs/trace_importer_job_test.rb (7)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/2120.patch
https://github.com/openstreetmap/openstreetmap-website/pull/2120.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/2120
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190116/31aac567/attachment-0001.html>


More information about the rails-dev mailing list