Skip to content

Commit

Permalink
fix: don't use deprecated Time.now
Browse files Browse the repository at this point in the history
  • Loading branch information
kimburgess committed Dec 12, 2019
1 parent c1606db commit 79abbae
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/flux/data_point_spec.cr
Expand Up @@ -29,7 +29,7 @@ describe Flux::DataPoint do

describe "to_s" do
it "serializes to line procotol" do
time = Time.now
time = Time.utc
ts = time.to_unix
point = Flux::DataPoint.new "foo", time, a: 1
point.tag :test, "bar"
Expand Down
2 changes: 1 addition & 1 deletion spec/flux/line_protocol_spec.cr
Expand Up @@ -2,7 +2,7 @@ require "../spec_helper"

describe Flux::LineProtocol do
describe ".serialize" do
time = Time.now
time = Time.utc
ts = time.to_unix

it "serializes a simple point to line protocol" do
Expand Down
2 changes: 1 addition & 1 deletion src/flux/data_point.cr
Expand Up @@ -15,7 +15,7 @@ struct Flux::DataPoint
getter timestamp : Time

# Creates a new data point that can be serialized for entry to InfluxDB.
def initialize(@measurement, @timestamp = Time.now, @tags = nil, **fields : **T) forall T
def initialize(@measurement, @timestamp = Time.local, @tags = nil, **fields : **T) forall T
raise ArgumentError.new "points must include at least one field" if fields.empty?

@fields = FieldSet.new
Expand Down

0 comments on commit 79abbae

Please sign in to comment.