Nebo15 / annon.api

Configurable API gateway that acts as a reverse proxy with a plugin system.
http://docs.annon.apiary.io/
MIT License
332 stars 26 forks source link

Ensure matching priority is in :ets key #245

Closed gmile closed 7 years ago

gmile commented 7 years ago

Update: the PR was updated to include matching_priority instead of inserted_at as it was initially. See original description below.

This also fixes the build.


Original description:

Before:

iex(1)> for {_, api, _, _} <- :ets.tab2list(:configuration), do: IO.puts api.inserted_at
2017-05-07 22:59:40.703795Z
2017-05-24 11:51:44.956792Z
2017-05-24 09:28:34.235263Z
2017-05-10 16:48:00.736411Z
2017-05-11 12:32:50.745892Z
2017-05-15 13:59:01.783186Z
2017-05-11 12:09:26.882815Z
2017-05-10 08:39:57.107934Z
2017-05-11 11:53:21.318624Z
2017-05-25 17:08:25.963739Z
2017-05-17 11:49:41.553655Z
2017-05-12 14:10:39.957690Z
2017-05-11 10:12:04.932357Z
2017-05-11 12:09:25.737372Z
2017-05-11 12:30:58.235430Z
2017-05-11 12:08:02.986755Z
2017-05-18 12:36:40.517500Z
2017-05-25 17:08:16.817616Z
2017-05-07 23:23:18.283755Z
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok,
 :ok, :ok, :ok]
iex(2)>

After:

iex(1)> for {_, api, _, _} <- :ets.tab2list(:configuration), do: IO.puts api.inserted_at
2017-05-07 22:59:40.703795Z
2017-05-07 23:23:18.283755Z
2017-05-10 08:39:57.107934Z
2017-05-10 16:48:00.736411Z
2017-05-11 10:12:04.932357Z
2017-05-11 11:53:21.318624Z
2017-05-11 12:30:58.235430Z
2017-05-11 12:09:25.737372Z
2017-05-11 12:32:50.745892Z
2017-05-11 12:09:26.882815Z
2017-05-11 12:08:02.986755Z
2017-05-12 14:10:39.957690Z
2017-05-15 13:59:01.783186Z
2017-05-17 11:49:41.553655Z
2017-05-18 12:36:40.517500Z
2017-05-24 09:28:34.235263Z
2017-05-24 11:51:44.956792Z
2017-05-25 17:08:16.817616Z
2017-05-25 17:08:25.963739Z
[:ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok, :ok,
 :ok, :ok, :ok]
iex(2)>
coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 20c8f7d32115f59d3642a402a9cc7b7f1072e780 on ensure-stuff-is-stored-properly-ordered into on master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 9188b70eeb3b31043333910c3c161a67802d2af2 on ensure-stuff-is-stored-properly-ordered into on master.

coveralls commented 7 years ago

Coverage Status

Changes Unknown when pulling 590dee24787aec045faf2c34076b8a20028f6ed3 on ensure-stuff-is-stored-properly-ordered into on master.