<p>Coming out of the conversations in <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="14297362" data-permission-text="Issue title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/281" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/281/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/281">#281</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="321490578" data-permission-text="Issue title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/1852" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/1852/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/1852">#1852</a>, I've started working on a mechanism to import and delete traces using the job queue, and avoiding the need for the <a href="https://github.com/openstreetmap/gpx-import">external gpx importer</a> completely.</p>
<p>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.</p>
<p>Beyond this stage, I would see the plan (in no particular order) as roughly:</p>
<ul>
<li>Write some tests to make sure this all works</li>
<li>Get the animated gifs working (see <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="367472316" data-permission-text="Issue title is private" data-url="https://github.com/dark-panda/gd2-ffij/issues/18" data-hovercard-type="issue" data-hovercard-url="/dark-panda/gd2-ffij/issues/18/hovercard" href="https://github.com/dark-panda/gd2-ffij/issues/18">dark-panda/gd2-ffij#18</a>)</li>
<li>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</li>
<li>Fix the importing to use <a href="https://github.com/zdennis/activerecord-import">activerecord-import</a>, to cut down the number of inserts per trace</li>
</ul>
<p>OSMF can then switch off the external importer and use this one instead.</p>
<p>Initial thoughts/comments/etc welcome. Big thanks to <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/hovercards?user_id=5842757" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/mmd-osm">@mmd-osm</a> for investigating both gd2-ffij and activerecord-import</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/2120'>https://github.com/openstreetmap/openstreetmap-website/pull/2120</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Sketch out how to use the jobs queue for trace insertion and deletion</li>
  <li>Add a configuration flag for using the job queue to import traces</li>
  <li>Use gd-ffij gem to create trace icons</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-0">Gemfile</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-1">Gemfile.lock</a>
    (3)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-2">app/controllers/traces_controller.rb</a>
    (2)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-3">app/jobs/application_job.rb</a>
    (7)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-4">app/jobs/trace_destroyer_job.rb</a>
    (10)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-5">app/jobs/trace_importer_job.rb</a>
    (19)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-6">config/example.application.yml</a>
    (4)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-7">lib/daemons/gpx_import.rb</a>
    (59)
  </li>
  <li>
    <strong>D</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-8">lib/daemons/gpx_import_ctl</a>
    (23)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-9">lib/gpx.rb</a>
    (121)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-10">test/jobs/trace_destroyer_job_test.rb</a>
    (7)
  </li>
  <li>
    <strong>A</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120/files#diff-11">test/jobs/trace_importer_job_test.rb</a>
    (7)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2120.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/2120.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/2120.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/2120.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2120">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLZjdnqZb2tnw-IqZkjIvRZp1Qfi2ks5vD0XJgaJpZM4aDUsB">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABWnLem_kODpE37eHWKKAdSSRwKeg8F3ks5vD0XJgaJpZM4aDUsB.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"[WIP] Trace import using ActiveJob (#2120)"}],"action":{"name":"View Pull Request","url":"https://github.com/openstreetmap/openstreetmap-website/pull/2120"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2120",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2120",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>