<AndreYuhai>
I want to run my scripts on two different machines which are using the same DB. How can I make the queries synchronous? Because when one is trying to insert something the other one might have already inserted which would give me Duplicate error.
<livcd_>
unique index? constraints?
plutes has joined #ruby
<AndreYuhai>
livcd_, but how does that help when two scripts are trying to insert the same thing at the same time?
conta has joined #ruby
henninb has quit [Quit: leaving]
oddp has joined #ruby
xco has joined #ruby
conta has quit [Quit: conta]
<jhass>
it's very usecase/context specific, hard to give general advice here
TCZ has joined #ruby
<jhass>
you could lock the table, but that'll probably be slower than just catching the constraint violation and moving on
<jhass>
architectual solutions might be splitting the work such that the attempt is never made
memcorrupt has quit [Ping timeout: 265 seconds]
roadie has quit [Ping timeout: 272 seconds]
waheedi has joined #ruby
<AndreYuhai>
jhass, Alright, thanks. Can I use sidekiq without rails, or anything alike?
<jhass>
sure, why not
<AndreYuhai>
Oh I wasn't sure. Thank you :)
conta has joined #ruby
conta has quit [Client Quit]
bijan_ has joined #ruby
dfucci has joined #ruby
dfucci has quit [Ping timeout: 264 seconds]
bijan_ has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
leah2_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
pwl has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
pwl_ has joined #ruby
rafadc has joined #ruby
pwl has quit [Client Quit]
pwl_ has quit [Client Quit]
pwl has joined #ruby
ellcs1 has joined #ruby
leah2_ has quit [Ping timeout: 272 seconds]
TCZ has quit [Quit: Leaving]
leah2_ has joined #ruby
leah2_ has quit [Ping timeout: 244 seconds]
schne1der has joined #ruby
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
alfiemax has joined #ruby
TCZ has joined #ruby
conta has joined #ruby
conta has quit [Client Quit]
howdoi has joined #ruby
alfiemax has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 256 seconds]
sgen has joined #ruby
al2o3-cr has joined #ruby
conta has joined #ruby
conta has quit [Client Quit]
ellcs1 has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
leah2_ has joined #ruby
Garb0 has quit [Quit: I'm out.]
sgen has quit [Ping timeout: 240 seconds]
leitz has joined #ruby
spectra has quit [Ping timeout: 272 seconds]
leah2_ has quit [Ping timeout: 260 seconds]
orbyt_ has joined #ruby
spectra has joined #ruby
spectra has joined #ruby
spectra has quit [Changing host]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
burak_ has joined #ruby
burak_ is now known as Guest92351
leah2_ has joined #ruby
leah2_ has quit [Excess Flood]
leah2_ has joined #ruby
AndreYuhai has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
schne1der has quit [Ping timeout: 264 seconds]
akem has quit [Remote host closed the connection]
akem has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
leah2_ is now known as leah2
TCZ is now known as tcz
Guest92351 has quit [Quit: Leaving]
SuperLag has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ChmEarl has joined #ruby
pwnd_nsfw has quit [Remote host closed the connection]
nicholaslyang has quit [Ping timeout: 240 seconds]
SuperLag has quit [Ping timeout: 256 seconds]
reffle has joined #ruby
SuperLag has joined #ruby
alfiemax has joined #ruby
Jesfre has quit [Ping timeout: 265 seconds]
alfiemax has quit [Remote host closed the connection]
dfucci has joined #ruby
dfucci has quit [Ping timeout: 246 seconds]
tau has joined #ruby
tau has quit [Changing host]
tau has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
imode has joined #ruby
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
duderonomy has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
oddp has quit [Ping timeout: 265 seconds]
<deimos_>
havenwood: thanks for the help yesterday. :["city1", "city2"] ended up being a symbol, which complicated things more, so i unwound more of the code, and treated them as an array and the value as another array, and then just did basic associative math to create a hash where :city1=>distance1, :city2=>distance2, etc.
<deimos_>
i know arrays are slower than hashes, but maximum possible sizes of this array are < 1000, so in benchmarking, the performance difference is neglible and the code is far easier to follow and read for now (for me at least)
<deimos_>
all this because i agreed to help a friend and look at their code
dionysus69 has joined #ruby
Jesfre has joined #ruby
tcz has joined #ruby
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
BitMac has joined #ruby
Garb0 has joined #ruby
Garb0 has quit [Max SendQ exceeded]
Garb0 has joined #ruby
dionysus69 has quit [Ping timeout: 246 seconds]
alfiemax has joined #ruby
tcz has quit [Quit: Leaving]
tau has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 265 seconds]
dfucci has joined #ruby
Jesfre has quit [Ping timeout: 240 seconds]
tcz has joined #ruby
dfucci has quit [Ping timeout: 265 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DEac- has joined #ruby
drincruz has joined #ruby
Garb0 has quit [Quit: I'm out.]
howdoi has quit [Quit: Connection closed for inactivity]
Jesfre has joined #ruby
oddp has joined #ruby
r3m has quit [Quit: WeeChat 2.9-dev]
r3m has joined #ruby
davispuh has joined #ruby
jegade has joined #ruby
jeromelanteri has joined #ruby
<jegade>
hi, i try to install a old version for some migration purpose but the installation failed
r29v has joined #ruby
<jegade>
rack-cache requires Ruby version >= 2.3.0.
<jegade>
after i run gem install rails --version 3.2.13 with ruby 1.9.3
ellcs1 has joined #ruby
BitMac has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeromelanteri has quit [Ping timeout: 240 seconds]
jeromelanteri has joined #ruby
quazimodo has quit [Ping timeout: 246 seconds]
quazimodo has joined #ruby
jeromelanteri has quit [Ping timeout: 240 seconds]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeromelanteri has joined #ruby
Jesfre has quit [Ping timeout: 246 seconds]
jeromelanteri has quit [Ping timeout: 260 seconds]
jeromelanteri has joined #ruby
jetchisel has joined #ruby
quazimodo has quit [Ping timeout: 256 seconds]
jeromelanteri has quit [Ping timeout: 246 seconds]
quazimodo has joined #ruby
jeromelanteri has joined #ruby
drincruz has quit [Ping timeout: 256 seconds]
envex has joined #ruby
orbyt_ has joined #ruby
jeromelanteri has quit [Ping timeout: 264 seconds]
imode has quit [Ping timeout: 246 seconds]
envex has quit [Ping timeout: 246 seconds]
jeromelanteri has joined #ruby
jeromelanteri has quit [Ping timeout: 240 seconds]
teej has quit [Quit: Connection closed for inactivity]
jeromelanteri has joined #ruby
jeromelanteri has quit [Ping timeout: 240 seconds]
waheedi has quit [Quit: waheedi]
hiroaki_ has quit [Ping timeout: 258 seconds]
tcz has quit [Quit: Leaving]
hiroaki_ has joined #ruby
Jesfre has joined #ruby
imode has joined #ruby
waheedi has joined #ruby
ellcs1 has quit [Ping timeout: 260 seconds]
tcz has joined #ruby
tau has joined #ruby
tau has joined #ruby
tau has quit [Changing host]
plutes has quit [Ping timeout: 272 seconds]
dionysus69 has joined #ruby
tau has quit [Ping timeout: 256 seconds]
tcz has quit [Quit: Leaving]
reffle has quit [Quit: This computer has gone to sleep]