- I am about to say many stupid stuff, mostly based on experience
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nov 03 17:56:52 rema-mine-ansatte app/web.4: source=rack-timeout id=5cbf5e4f-1011-4b45-8205-8ce70df979dd wait=94ms timeout=29000ms state=ready | |
Nov 03 17:56:52 rema-mine-ansatte app/web.4: Processing by API::V1::EmployeesController#create as JSON | |
Nov 03 17:56:52 rema-mine-ansatte app/web.4: Started POST "/api/v1/stores/1111/employees.json" for 62.92.0.125 at 2015-11-03 16:56:51 +0000 | |
Nov 03 17:56:52 rema-mine-ansatte app/web.4: Parameters: {"employee"=>{"address"=>"Ratvikveien 435", "age_group"=>"", "bank_account_number"=>"[FILTERED]", "birthdate"=>"1974-06-30", "city"=>"Åfjord", "collective_agreement"=>"1", "complete"=>"", "country_code"=>"NO", "display_name"=>"Anita Helen By", "draft_id"=>"5638e319633532000d000000", "email_address"=>"[email protected]", "employment_percent"=>"13.33333333333333", "employment_type"=>"1", "end_date"=>"", "first_name"=>"Anita Helen", "hourly_pay_entry_date"=>"2015-11-03 00:00:00 +0000", "hourly_pay_level"=>"9", "hourly_pay_premium_currency"=>"", "hourly_pay_premium_pe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ErrorNormalization | |
extend ActiveSupport::Concern | |
included do | |
rescue_from CanCan::AccessDenied, with: :render_forbidden | |
rescue_from ActiveRecord::RecordNotFound, with: :render_not_found | |
rescue_from ActionController::ParameterMissing, with: :render_bad_request | |
end | |
def render_forbidden |
Bug Reproduction: ActiveRecord::StatementInvalid: PG::DuplicatePstatement: ERROR: prepared statement "XXX" already exists
so basically here in postgres_adapter.rb
I am manually raising a raise Rack::Timeout::RequestTimeoutError
and if that exception is captured, the code continues to execute, then the next time the code wants to access the DB the PG::DuplicatePstatement: ERROR
will occurr.
the way to solve this is to add a begin/ensure
block to the affected area to make sure prepared statements are generated correctly
NOTE: i raise the error when the counter gets to 130
since this method is excecuted many times
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Organization | |
class Group | |
# belongs_to :parent, class_name: 'Organization::Group' | |
# has_many :children, class_name: 'Organization::Group', | |
# foreign_key: :parent_id | |
# has_many :group_memberships, dependent: :destroy | |
# has_many :users, through: :group_memberships | |
RECURSIVE_UP = <<SQL.freeze |
this code is supposed to be run in the rails console
.
- run
fix_varner_organizations.rb
- for each organization identifier: (cubus, dressmann, urban... except carlings) do:
- set env variable
MYCHAIN_SYNCED_ORGANIZATIONS
to theorganization_identifier
in production.
- set env variable
- run a clean mychain import: make sure there is no MyChainSync record with
organization_identifier = 'varner'
, also modify theMYCHAIN_SYNCED_ORGANIZATIONS
to have one organization at a time, for not having problems with memory on production.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
/* | |
## Animated highlight over redacted code | |
To actually try to get a loading shimmer animation on redacted content | |
Interesting concepts: | |
- overlay + `.blendMode` |
OlderNewer