Skip to content

Commit

Permalink
Use new timeunits
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Jul 14, 2018
1 parent f02579d commit 9e06407
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/plug/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ defmodule Plug.Logger do
Conn.register_before_send(conn, fn conn ->
Logger.log(level, fn ->
stop = System.monotonic_time()
diff = System.convert_time_unit(stop - start, :native, :micro_seconds)
diff = System.convert_time_unit(stop - start, :native, :microsecond)
status = Integer.to_string(conn.status)

[connection_type(conn), ?\s, status, " in ", formatted_diff(diff)]
Expand Down
2 changes: 1 addition & 1 deletion lib/plug/request_id.ex
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ defmodule Plug.RequestId do

defp generate_request_id do
binary = <<
System.system_time(:nanoseconds)::64,
System.system_time(:nanosecond)::64,
:erlang.phash2({node(), self()}, 16_777_216)::24,
:erlang.unique_integer()::32
>>
Expand Down
2 changes: 1 addition & 1 deletion lib/plug/upload.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule Plug.Upload do
end

defp path(prefix, tmp) do
sec = :os.system_time(:seconds)
sec = :os.system_time(:second)
rand = :rand.uniform(999_999_999_999_999)
scheduler_id = :erlang.system_info(:scheduler_id)
tmp <> "/" <> prefix <> "-" <> i(sec) <> "-" <> i(rand) <> "-" <> i(scheduler_id)
Expand Down
4 changes: 2 additions & 2 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
defmodule Plug.MixProject do
use Mix.Project

@version "1.6.1"
@version "1.7.0-dev"
@description "A specification and conveniences for composable modules between web applications"
@xref_exclude [:ranch, :cowboy, :cowboy_req, :cowboy_router, :cowboy_stream, :cowboy_stream_h]

def project do
[
app: :plug,
version: @version,
elixir: "~> 1.3",
elixir: "~> 1.4",
deps: deps(),
package: package(),
lockfile: lockfile(),
Expand Down

0 comments on commit 9e06407

Please sign in to comment.