fixes remove debugs

main
Guido Schweizer 2025-06-22 13:45:59 +02:00
parent 881b65f6a5
commit 47eb738400
3 changed files with 4 additions and 5 deletions

View File

@ -14,10 +14,10 @@ class LoadUserActivitiesJob < ApplicationJob
last_spotify_activity_at = latest_activity_iso(login.platform)
new_activities = client.load_since(last_spotify_activity_at)
# log some info about the response with status and parts of the body
Rails.logger.info("Response: #{new_activities}")
Rails.logger.info("Response status: #{new_activities&.status}")
create_action = CreateSpotifyActivity.new(user, new_activities)
create_action.perform
logger.info("Loading for #{user.id} finished with #{new_activities.size} new activities")
logger.info("Loading for #{user.id} finished with")
rescue StandardError => e
Rails.logger.error(e)
end

View File

@ -11,7 +11,6 @@ class CreateSpotifyActivity
begin
# log some info about the response with status and parts of the body
Rails.logger.info("Response status: #{response["status"]}")
Rails.logger.info("Response body: #{response["body"]}")
counts = response["items"].size
Rails.logger.info("Saving #{counts} activities")
response["items"].reverse.each do |play|

View File

@ -42,12 +42,12 @@ class SpotifyClient
call(path, params)
rescue RestClient::ExceptionWithResponse => e
if e.response.code == 401
puts "token expired, forcing refresh"
Rails.logger.info("token expired, forcing refresh")
refresh_token!(force: true)
begin
call(path, params)
rescue RestClient::ExceptionWithResponse
puts "token dead"
Rails.logger.info("token dead")
LogLoadFailedWorker.perform_async(login.id)
end
end