Skip to content

Commit 9f44b9b

Browse files
committed
fix types
1 parent e1884fa commit 9f44b9b

File tree

27 files changed

+617
-143
lines changed

27 files changed

+617
-143
lines changed

bin/watch_specs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ puts "Press Ctrl-C to stop."
2727
listener = Listen.to("spec/") do |modified, added, removed|
2828
if (modified + added + removed).any?
2929
changed_files = (modified + added + removed).join(", ")
30-
puts "\n#{Time.zone.now}: Changes detected in: #{changed_files}"
30+
puts "\n#{Time.current}: Changes detected in: #{changed_files}"
3131

3232
run_tapioca_dsl
3333

34-
puts "Tapioca dsl completed at #{Time.zone.now}"
34+
puts "Tapioca dsl completed at #{Time.current}"
3535
puts "Watching for more changes..."
3636
end
3737
end

lib/log_struct/integrations/carrierwave.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,27 @@ def setup
2727
# Methods to add logging to CarrierWave operations
2828
module LoggingMethods
2929
def store!(file = nil)
30-
start_time = Time.zone.now
30+
start_time = Time.current
3131
result = super
32-
duration = (Time.zone.now - start_time) * 1000 # Convert to milliseconds
32+
duration = (Time.current - start_time) * 1000 # Convert to milliseconds
3333

3434
log_operation("store", file, duration)
3535
result
3636
end
3737

3838
def retrieve_from_store!(identifier)
39-
start_time = Time.zone.now
39+
start_time = Time.current
4040
result = super
41-
duration = (Time.zone.now - start_time) * 1000 # Convert to milliseconds
41+
duration = (Time.current - start_time) * 1000 # Convert to milliseconds
4242

4343
log_operation("retrieve", {identifier: identifier}, duration)
4444
result
4545
end
4646

4747
def remove!
48-
start_time = Time.zone.now
48+
start_time = Time.current
4949
result = super
50-
duration = (Time.zone.now - start_time) * 1000 # Convert to milliseconds
50+
duration = (Time.current - start_time) * 1000 # Convert to milliseconds
5151

5252
log_operation("remove", {identifier: identifier}, duration)
5353
result

lib/log_struct/log/carrierwave.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class CarrierWave < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::CarrierWave, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# File-specific fields

lib/log_struct/log/email.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Email < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::Mailer, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Email-specific fields

lib/log_struct/log/error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Error < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource # Used by all sources, should not have a default.
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Error-specific fields

lib/log_struct/log/job.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Job < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::Job, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Job-specific fields

lib/log_struct/log/notification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Notification < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::App, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Notification-specific fields

lib/log_struct/log/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Request < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::Rails, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Request-specific fields

lib/log_struct/log/shrine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Shrine < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::Shrine, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# File-specific fields

lib/log_struct/log/sidekiq.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Sidekiq < T::Struct
1414
# Common fields
1515
const :src, LogStruct::LogSource, default: T.let(LogStruct::LogSource::Sidekiq, LogStruct::LogSource)
1616
const :evt, LogStruct::LogEvent
17-
const :ts, Time, default: T.unsafe(-> { Time.zone.now })
17+
const :ts, Time, default: T.unsafe(-> { Time.current })
1818
const :msg, T.nilable(String), default: nil
1919

2020
# Sidekiq-specific fields

0 commit comments

Comments
 (0)