<ramfjord>
Hey all, I've got a rails question that's a bit of a longshot. Let me know if I'm doing anything too crazy here. I've set up a controller.process_action subscription, which has been great for easily sending statsd metrics for each request broken down by status, etc. But our statsd provider charges us based on unique metrics tags, so I don't want to tag these metrics too specifically. So I had an idea
<ramfjord>
of keeping a "failed_requests" log in the DB, which could store the arguments to a request, along with the number of times it's failed since the last time we cleared the failed_requests table. Anyway, the code to do this is here: https://gist.github.com/tramfjord/237924bde87cbe84f213b458bc5be104
<ramfjord>
the issue is: in my tests at least, it looks like my thread's postgres connection is sometimes inside an existing transaction, and sometimes even a rolled back one, when the subscription is triggering
greengriminal has quit [Quit: This computer has gone to sleep]
<ramfjord>
hence I'm getting these errors like ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block
<ramfjord>
Is there a way I can just say: "end whatever transaction you're in, start a new one"
<ramfjord>
I'm 99% sure we are using `transaction` blocks for all transactions in this app, rather than manually `execute("BEGIN")` ing
<ramfjord>
crap this is the ruby IRC, not the RoR irc?
Technodrome has joined #ruby
<ramfjord>
if anyone can help would nevertheless be greatly appreciated
Xiti has joined #ruby
jenrzzz_ has quit [Ping timeout: 276 seconds]
gearnode has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
Rounin has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
FocalFossa0997 has joined #ruby
FocalFossa0997 has quit [Client Quit]
jenrzzz_ has quit [Ping timeout: 265 seconds]
neshpion has quit [Quit: neshpion]
patrick99e99 has joined #ruby
teardown has quit [Ping timeout: 268 seconds]
<patrick99e99>
why is it that if I do: File.expand_path(Dir.entries(File.expand_path(Dir.entries('.')[2]))[2])
<patrick99e99>
given I have a directory with [".", "..", "bob", "xyz", "a.blah"]
<patrick99e99>
and bob is a folder with [".", "..", "lol"]
<patrick99e99>
I am expecting to get "/path/to/bob/lol"
<patrick99e99>
but instead I get "/path/to/lol"
<patrick99e99>
which is not the right path
stdedos has quit [Quit: Connection closed]
jenrzzz_ has joined #ruby
hhnxsG has joined #ruby
supercoven_ has joined #ruby
supercoven_ has quit [Max SendQ exceeded]
supercoven_ has joined #ruby
supercoven_ has quit [Max SendQ exceeded]
supercoven_ has joined #ruby
supercoven has quit [Ping timeout: 276 seconds]
jenrzzz_ has quit [Ping timeout: 264 seconds]
swaggboi has joined #ruby
va5c0 has joined #ruby
<leftylink>
well, lol is just a string. so you're saying, File.expand_path("lol")
<leftylink>
so of course File.expand_path has no way to know that "bob" is supposed to be in the expanded path
hiroaki_ has quit [Ping timeout: 272 seconds]
jenrzzz_ has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
hhnxsG has quit [Quit: Connection closed]
ramfjord has quit [Ping timeout: 276 seconds]
hhnxsG has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 276 seconds]
jenrzzz_ has joined #ruby
teardown has joined #ruby
jenrzzz_ has quit [Ping timeout: 265 seconds]
jenrzzz_ has joined #ruby
gearnode has quit [Ping timeout: 272 seconds]
ritsch_master has quit [Remote host closed the connection]
dpl has joined #ruby
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
shtirlic has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
dpl has quit [Remote host closed the connection]
dpl has joined #ruby
dpl has quit [Remote host closed the connection]
dpl has joined #ruby
dpl has quit [Remote host closed the connection]
dpl has joined #ruby
jenrzzz_ has quit [Ping timeout: 265 seconds]
shtirlic has joined #ruby
Guest21 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz_ has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hhnxsG has quit [Quit: Connection closed]
jenrzzz_ has quit [Ping timeout: 240 seconds]
jenrzzz_ has joined #ruby
deviantfero has quit [Quit: WeeChat 3.0]
Swyper has joined #ruby
jenrzzz_ has quit [Ping timeout: 240 seconds]
Swyper has quit [Ping timeout: 264 seconds]
dpl has quit [Ping timeout: 272 seconds]
va5c0 has quit [Ping timeout: 264 seconds]
michxf has joined #ruby
Xiti` has joined #ruby
jenrzzz_ has joined #ruby
Xiti` has quit [Remote host closed the connection]
DTZUZU has quit [Read error: Connection reset by peer]
Xiti has quit [Ping timeout: 264 seconds]
DTZUZU has joined #ruby
jenrzzz_ has quit [Ping timeout: 276 seconds]
jenrzzz_ has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
jenrzzz_ has quit [Ping timeout: 246 seconds]
jenrzzz_ has joined #ruby
patrick99e99 has quit [Ping timeout: 276 seconds]
jenrzzz_ has quit [Ping timeout: 264 seconds]
jenrzzz_ has joined #ruby
patrick99e99 has joined #ruby
ChmEarl has quit [Quit: Leaving]
jenrzzz_ has quit [Ping timeout: 264 seconds]
m27frogy has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 264 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz_ has joined #ruby
Xiti has joined #ruby
michxf has quit [Quit: michxf]
jenrzzz_ has quit [Ping timeout: 246 seconds]
dpl_ has joined #ruby
jenrzzz_ has joined #ruby
Benett has quit [Ping timeout: 240 seconds]
Benett has joined #ruby
jenrzzz_ has quit [Ping timeout: 265 seconds]
jenrzzz_ has joined #ruby
jenrzzz_ has quit [Ping timeout: 272 seconds]
abhijit has joined #ruby
<abhijit>
Hi All. which library should I use to capture mouse scroll wheel and map it to something else?
<abhijit>
through ruby coding.
<drusepth>
are you using some ui library already or is this in a console?
orbyt_ has joined #ruby
dpl_ has quit [Ping timeout: 276 seconds]
jenrzzz_ has joined #ruby
<abhijit>
console
<abhijit>
i can use some ui library if that is required
<drusepth>
are you trying to remap globally across the whole system, or just when the app is focused?
<weaksauce>
cloud69 call scrape_post_links with a parameter?
<weaksauce>
instead of a hard coded url
<weaksauce>
PAGES.each do |url| scrape.scrape_post_links(url) end
kaivai has joined #ruby
Rounin has joined #ruby
jenrzzz_ has quit [Ping timeout: 245 seconds]
<cloud69>
neat! one sec
kristian_on_linu has quit [Remote host closed the connection]
neshpion has joined #ruby
<cloud69>
weaksauce: Updated the gist, hopefully im doing it right
adu_ has quit [Quit: adu_]
gearnode has joined #ruby
va5c0 has joined #ruby
<cloud69>
Not sure how to handle `PAGES = [{ url: ..., category: ...}, { url: ..., category: ...}]`
zolferino has joined #ruby
zolferino has quit [Excess Flood]
<leftylink>
one could not have it at all if the category can always be determined from the url in thee same way. but wemight suppose that soe urls are different so it is not possible to do that
<leftylink>
in which case, one has the choice of either passing the hash and making Scraper extract the values, or passing #values_at only