The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-11-10

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:09 sri bpmedley: job results are in https://github.com/kraih/minion/commit/b2b18b7482beee9ce057eedb022ef3fc0e71a3b7
00:10 denny joined #mojo
00:10 bpmedley Sweet.  Want me to add results to Pg.pm?
00:10 sri if you're up for it, of course
00:15 jwang joined #mojo
00:20 janus joined #mojo
00:25 bpmedley Looking at it now
00:36 sri it's really simple
00:36 sri error just becomes a json field with the name result
00:36 sri and _update gets simpler
00:37 bpmedley https://github.com/brianmed/minion/blob/master/lib/Minion/Backend/Pg.pm <— Thoughts?
00:37 sri that was quick
00:38 bpmedley I have a copy of your brain here.  Mind meld.
00:38 sri i should have known
00:38 bpmedley I hope I did the git stuff correct.  Still learning on that point.
00:39 sri looks like it
00:39 purl No it doesn't, shut your hole!
00:39 * sri punches purl on the nose
00:45 sri some sort of support for fixtures in Mojo::Pg would be nice
00:46 bpmedley Hrrm.  I had to google: is that a known state for something?
00:46 sri but i can't think of an implementation that would allow parallel testing
00:46 sri default content for tables
00:47 sri http://guides.rubyonrails.org/testing.html#the-low-down-on-fixtures
00:48 sri perhaps some sort of shared lock
00:49 sri like a scope guard for every fixtures using test script, the first inserts fixtures, and the last removes them again
00:50 bpmedley Interesting.
00:52 marcus joined #mojo
00:53 sri or perhaps a more meta solution would be appropriate
00:53 sri like test script exclusive locks
00:53 bpmedley sri: Just saw your pull request message.  When should I do that?
00:53 sri bpmedley: whenever you feel like it
00:54 bpmedley Just click the Pull Request link?
00:54 sri no idea if want half a pull request in your history
00:57 bpmedley Pull request made.  Does it look correct?
00:58 sri it's ok :)
00:58 sri normally it would of course be an instant rejection
00:58 bpmedley ?
00:58 sri lack of docs and schema handling
00:58 bpmedley Sure, I was surprised you didn’t ask for the documentation.. :)
00:59 * sri tends to only deal with complete pull requests, but since we are working together...
00:59 sri (just saying since you seem to be asking in more general terms)
00:59 bpmedley Cool stuff.  Awesomeness is high.
01:00 sri allright, i think i'll attach the migration to the first connection event emitted by the Mojo::Pg instance
01:01 sri then the schema gets sync'd once per process before the first database interaction
01:38 bpmedley http://firnsy.com/blog/mojolicious-is-freakin-awesome
01:39 firnsy yes, yes it is
01:39 purl oh no it isn't
01:39 bpmedley firnsy: Sweet!
01:39 firnsy shut up purl
01:39 purl Yes, sir.
01:44 sri :)
02:00 marcus joined #mojo
02:27 KCL_ joined #mojo
02:32 laouji joined #mojo
02:50 brainbuz joined #mojo
02:55 jb360 joined #mojo
03:22 bwf joined #mojo
03:38 hoppie joined #mojo
03:40 hoppie Net-DNS-Native-0.12 seems to be solid now. I failure under Linux which seems odd. http://www.cpantesters.org/cpan/report/7bdab09c-67ff-11e4-9ce3-9a752656b80b
03:46 sujithm joined #mojo
04:13 Snelius 5.10 is to old i think
04:14 * jberger slaps purl with a fish
04:14 * purl slaps jberger with comically large fish in return
04:29 hoppie joined #mojo
04:35 hoppie Snelius: Good catch. Perhaps Perl 5.10 comes with an older Socket.pm. Net-DNS-Native-0.12 requires Socket 1.94.
04:38 jberger bpmedley++ sri++
04:38 bpmedley Thanks
04:39 jberger firnsy++
04:39 hoppie Snelius: just checked Perl 5.10.1 on CentOS 6.5. That comes with Socket 1.82
04:39 Snelius hoppie: yes it is. 5.14 ot newer required
04:39 jberger 5.10--
04:39 hoppie jberger, you forgot me. I gave Oleg 2 good test scripts which were helpful for getting Net-DNS-Native-0.12.
04:39 jberger Socket is dual lifed though right?
04:40 jberger hoppie++ also was the impetus for getting the whole thing rolling
04:41 hoppie https://github.com/olegwtf/p5-Net-DNS-Native/issues?q=is%3Aissue+is%3Aclosed
04:41 jberger sri had been talking about nonblocking  resolver for as long as I can remember
04:41 Snelius DNS::Native is included now
04:41 hoppie jberger: I was feeling bad during the entire roller coster.  I was saying what have I done... :)
04:41 Snelius it is a good thing
04:42 jberger you do have to be careful in #mojo
04:42 basic6 joined #mojo
04:42 jberger sometimes you ask a question and entire features get deprecated
04:42 jberger it happens
04:42 sri what do we deprecate today?
04:42 hoppie ok. glad to have helped a little bit. was helpful with testing, even when almighty "sri" said otherwise and etc... :(.   But, I felt responsible and persisted otherwise.
04:43 jberger getting things done++ # even if it's messy sometimes
04:44 hoppie what do you guys recommend for folks running on RedHat/CentOS 6.5 stuck with Perl 5.10.1 running Socket 1.82?
04:44 * jberger deprecates tempire
04:44 jberger hoppie: perlbrew
04:44 purl it has been said that perlbrew is just so nice.
04:44 firnsy hoppie, package a newer Socket
04:45 * jberger hugs purl
04:45 purl jberger: get off me, you botvert!
04:45 bpmedley hoppie: I like: https://metacpan.org/pod/distribution/Perl-Build/script/perl-build
04:45 hoppie bpmedley: thanks. will take a look.
04:45 jberger perl-build is perlbrew lite (literally)
04:46 sri lite brew? no thanks!
04:46 bpmedley After building the perl I want I put an /opt/perl symlink to the “latest” perl.  This way my schebang is #!/opt/perl and I can easilly change my user perl across lots of scripts.
04:47 * jberger hands sri a Busch Light and runs
04:47 * sri throws it after jberger
04:47 jberger oh or PBR light (do they even make that? )
04:47 hoppie jberger: to be fair want to give a +1 to Gavin Carr for http://www.openfusion.net/talks/pwp/. Otherwise, would not have created the silly script I wrote which failed causing for issue 700 to be created and the roller coster for getting a non-blocking resolver.
04:48 sri non-blocking resolver support is actually a very old topic for us
04:48 hoppie sri, did not know that for being new here.
04:49 jberger it was a great confluence of a failing case and a workable solution showing up literally within a few days of each other
04:50 hoppie It's the 191 silly URLs -- otherwise was hard to reproduce.
04:50 sri https://github.com/kraih/mojo/commit/6c205e484e09336ef3d78dbc78768d80daca6b17
04:50 sri goes back to 2011
04:50 hoppie wow. why did it take so long...
04:51 jberger then when NDN was first released we almost added support immediately, but it wasn't x platform enough yet
04:51 jberger hoppie: it's a hard thing and NDN is very new
04:51 hoppie Amazing how things comes together at times.
04:51 jberger I always assumed it would be libuv that would get it in the door
04:52 jberger but I never had the time to work on wrapping it
04:52 hoppie I was influenced by the presentation by Gavin Carr. Mojo was missing there ... and thought "hey" let's try Mojo...  Was crazy...
04:53 jberger hoppie spread the word!
04:53 hoppie jberger, yes... most definitely... you can count on me for that.
04:53 jberger hoppie++
04:54 jberger Also, isn't the pace of mojo development kinda exciting?
04:54 jberger something definitely lacking in the broader perl community imo
04:55 hoppie yes, for me personally though, I worry about the breaking changes if ever to upgrade. It seems better now. API has stabilized. you guys are stating deprecated stuff, etc.
04:55 bpmedley Yes, the pace is exciting. I think that’s one reason the Mojo community is growing.
04:55 hoppie basically not worried as much about that.
04:56 hoppie Mojo is really nice.
04:57 hoppie I have a question though and it may be ignorance on my part. I'm looking up the pastie URL... It's a good question.
05:01 hoppie Why does one do Mojo::IOLoop->delay( ... )->wait for one item?  jberger, earlier you mentioned a pastie # 9706335 (sorry do not have the link). I had saved it.
05:02 hoppie http://pastie.org/9706335
05:05 hoppie When writing Mojo scripts, I like to follow the style, syntax, etc.  Was just wondering about doing Mojo::IOLoop->delay( ... )->wait if it's for one URL. Perhaps one gets a lot of goodies with delay such as catch.
05:07 jberger you get one other big thing, leak protection
05:08 jberger Also, I've just gotten into the habit
05:08 hoppie ah... ok... that makes sense. thank you for the enlightenment. I remember reading about that.
05:09 hoppie So, lots of goodies... I see the ->catch (looks nice) and you mentioned leak protection which is important.
05:10 jberger a tiny benefit is future proofing your code
05:10 bwf left #mojo
05:10 jberger if I need to add a step later, I don't have to reactor
05:10 hoppie And if ever the app were to support many URLs, one already has a head start with writing that way.
05:10 jberger refactor
05:10 purl hmmm... refactor is changing the structure a bit and eliminating the %metaclass table.
05:11 hoppie future proofing is ++. wow... Mojo is really nice.
05:12 jberger <3 mojo
05:12 * jberger kicks purl
05:12 * purl blocks!  Paint the fence!
05:14 hoppie like step ++ (it's an awesome feature)
05:15 hoppie can i ask who added the step feature to Mojo?
05:16 hoppie that person (and folks) rock. I like how it retains order between steps.
05:19 jberger hoppie: that started as a port of a js library (step.js?)
05:19 jberger and has been evolving since
05:20 hoppie ah. never heard of step.js
05:23 jberger for many people the web frame work is the most important part of mojo
05:23 Snelius hoppie: step as a part of node.js
05:24 jberger for me, ioloop, delay and event emitter and way more important
05:24 Snelius "steps" is very powerfull for me :)
05:24 jberger s/and/are/
05:24 hoppie I have some news to share when testing various modules.  Mojo wins.
05:25 jberger \o/
05:25 jberger Snelius: steps is part of delay
05:25 hoppie Did you know that only "Mojo" works for an app running threads (not forking).  LWP (even) AnyEvent cannot do the HTTP crawling using threads.
05:26 Snelius jberger: yes of course
05:27 jberger hoppie: it can fork too (inside of a worker) as I have shown with fork call
05:27 jberger (with a few caveats, but for the most part)
05:28 jberger lwp is not thread safe?!
05:28 Snelius and what is thread safe generally? :)
05:28 hoppie jberger. yes. the other day was testing to see which of these will succeed (running entirely threads only): LWP, AnyEvent::HTTP, Mojo.  Only Mojo passed.
05:29 hoppie $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll';   <-- that's needed if running only threads.
05:29 hoppie Poll
05:30 Snelius why?
05:30 hoppie EV is not thread safe, thus the reason to set MOJO_REACTOR (thanks to sri for the tip)
05:30 Snelius poll is not required for threads
05:31 hoppie was running Mojo + MCE and testing to see if able to spawn MCE workers as threads (not fork -- default).
05:31 hoppie was doing Mojo::UserAgent. silly web crawling and IOLoop->delay
05:31 Snelius oh
05:38 hoppie Snelius: this was the pastie http://pastie.org/9689681.  One can add "use threads;" at the top. But needs to set MOJO_REACTOR to Mojo::Reactor::Poll.
05:39 Snelius ah, you perl threads about )
05:39 hoppie Mojo is already fast. And jberger/batman have folk modules for Mojo. I was just testing Mojo with MCE for the fun of it.
05:40 hoppie s/folk/fork/
05:41 jberger hoppie: why "use vars" and "our"?
05:41 hoppie That's not needed btw.
05:42 jberger our essentially replaces vars
05:42 hoppie my ($mce) = @_
05:42 hoppie and then $mce->{ua} = ... will do too
05:42 hoppie I thought our will not work it will be gone once out of the user_begin block.
05:44 jberger you can use our (I would just probably use a my in an outer scope) but you almost certainly don't need "use vars"
05:44 hoppie met to say our was not enough -- needed use vars too. Will retest that jberger. anyway will use my ($mce) = @_;  and set $mce->{ua} = Mojo::UserAgent->new(...)
05:45 jberger oh, the lexical scope!
05:45 purl i heard the lexical scope was orthogonal to packages, I dare say.
05:45 jberger our is a lexical alias
05:46 jberger put 'our $ ua' in an outer scope, then you can initialize wherever
05:46 hoppie yes. got that. Each worker starts -- each worker calls user_begin once before running (chunking). Think of awk BEGIN { user_begin } { user_func } { user_func } ... END { user_end }
05:47 jberger purl++
05:47 jberger tchrist himself taught me that lesson tho
05:47 hoppie well my var works in that case if outer scope. For any new examples with MCE, have started tagging to the $mce hash.
05:48 jberger vars just feels anachronistic
05:48 jberger but then again, perl is a language with many dialects
05:49 hoppie At the time, I spoke to a colleague at work and he mentioned a couple ways to handle it.
05:49 jberger call it King James perl
05:49 laouji joined #mojo
05:49 hoppie an example;  one would define $mce->{dbh} inside the user_begin block.  The user_func will then... my $dbh = $mce->{dbh}
05:50 hoppie The user_end block will then $mce->{dbh}->disconnect.
05:50 jberger hoppie: that's probably a better way to do it (rather than my)
05:50 jberger anyway, I have to get to bed
05:51 hoppie yes. that's how new (future) mce examples will be shown.
05:51 jberger weekends go too fast
05:51 jberger nn all
05:51 hoppie nn
05:58 sujithm joined #mojo
06:03 marcus joined #mojo
06:07 Averna joined #mojo
06:09 rem_lex| joined #mojo
06:12 irq joined #mojo
07:02 Eke- joined #mojo
07:17 dod joined #mojo
07:19 bpmedley joined #mojo
07:25 ryanc joined #mojo
07:50 damaya joined #mojo
07:58 sujithm joined #mojo
08:01 marcus joined #mojo
08:14 trone joined #mojo
08:15 Vandal joined #mojo
08:21 basiliscos joined #mojo
08:23 dp_ joined #mojo
08:42 meshl joined #mojo
09:10 vytas joined #mojo
09:40 neyasov_ joined #mojo
09:53 marcus joined #mojo
10:02 Shaeto joined #mojo
10:03 amon joined #mojo
10:03 doublelel joined #mojo
10:04 neyasov_ joined #mojo
10:06 neyasov__ joined #mojo
10:58 sujithm_ joined #mojo
11:04 sujithm joined #mojo
11:25 doublelel joined #mojo
11:48 bowtie_ joined #mojo
11:55 bowtie_ joined #mojo
11:57 marcus joined #mojo
12:21 ignacio_ joined #mojo
12:23 irq_ joined #mojo
12:30 al joined #mojo
12:40 hernan joined #mojo
12:50 denis_boyun joined #mojo
12:53 punter joined #mojo
12:56 bowtie_ joined #mojo
13:06 meshl joined #mojo
13:24 fhelmber_ joined #mojo
13:31 sri bpmedley: i think delayed can be easily handled on the server side
13:31 sri and be a timestamp
13:32 bowtie joined #mojo
13:32 neilhwatson joined #mojo
13:32 bpmedley Ok; cool.  I assume you’ve made a few adjustments here and there?
13:32 sri just start with a default of 0 seconds and add those to a now() on the server side with a placeholder
13:32 sri not yet
13:32 sri just had the idea
13:33 * sri just stumbled over this chunk of psql "(now()::time + interval '45' second)"
13:34 bpmedley So, we can do “(now()::time - internval ‘1’ second)”, perhaps?
13:34 sri or even '0' second
13:35 sri then it's just now
13:35 sri if the time is guaranteed to be consistent by the server, no need for a time in the past
13:37 sri the idea was "now()::time + interval  '45' second"
13:37 sri oops
13:37 sri the idea was "now()::time + interval ? second"
13:38 sri "select (now() + interval '0' second);" actually works, so it shouldn't be a problem :)
13:39 bpmedley delayed => $options->{delay} ? "(now() + interval '$$options{delay}' second)" : "now()",  <— Thoughts?
13:40 bpmedley In enqueue
13:40 sri ugly
13:41 sri and there is no need at all to make it ugly
13:41 marcus joined #mojo
13:41 bpmedley delayed => "(now() + interval '$$options{delay}' second)",   given $options->{delay} // 0
13:41 sri no
13:42 bpmedley I just woke up; so perhaps a hint?
13:42 sri (now()::time - internval ? second)
13:42 bpmedley Aha
13:42 sri umm
13:42 sri s/-/+/
13:47 marty joined #mojo
13:49 arthas joined #mojo
13:55 bwf joined #mojo
13:57 arthas joined #mojo
14:00 sujithm joined #mojo
14:28 KCL joined #mojo
14:40 bpmedley Sorry, I had to get ready for and now goto work.  Will be back in a few hours.
14:41 bowtie joined #mojo
14:51 sujithm joined #mojo
15:11 sh4 joined #mojo
15:23 punter joined #mojo
15:33 bowtie_ joined #mojo
15:39 marcus_ joined #mojo
15:40 doublelel joined #mojo
15:42 punter marcus, I'm going to improve Mojolicious::Plugin::OAuth2 for sync-mode again. Where can we open a dialog about it? Do you prefer the Mojolicious mailing list, or exchanging private emails?
15:44 marcus joined #mojo
16:02 meshl joined #mojo
16:12 neyasov__ joined #mojo
16:17 jb360 joined #mojo
16:20 punter joined #mojo
16:20 marcus joined #mojo
16:26 hasan joined #mojo
16:26 hasan I get the following error message in my mojo app: "*** Error in `lib/bin/morbo': corrupted double-linked list: 0x00000000046cca50 ***
16:31 Oleg joined #mojo
16:32 Oleg hasan: do you have Net::DNS::Native installed?
16:37 marcus joined #mojo
16:42 hasan Oleg: no
16:42 Oleg good :)
16:43 Oleg Then it looks like perl bug or bug of some XS module which mojo uses
16:53 hasan I am not experienced in debugging. but I will investigate.
16:54 Oleg btw, is it crashed or just warned?
16:58 paulg joined #mojo
17:00 paulg sri: I'm trying to understand if your fork of Promises (with the fieldhash) is actually doing of use or not, or what use cases it might cover
17:02 paulg sri: its somewhat difficault for me to follow, I've not used fieldhashes before, but it seems that breaking circular references are not its intended purpose, and im not sure that it actually does much to help in reference counting in anycase
17:03 marcus joined #mojo
17:03 sri paulg: Mojo::IOLoop::Delay has been using the same trick successfully for quite some time
17:04 paulg sri: your gist here seems like a working example: https://gist.github.com/kraih/11276761 if i run it against your fork, then the output of find_cycle is empty, which would look like its working...
17:04 sri it avoids circular references in closures stored in objects
17:05 * paulg nods, I'll look at that to see if it'll help me to understand better
17:05 sri it's a complicated topic
17:05 paulg sri: yes, I got that this was the intention, I just can't see the workings
17:05 sri which is why i'm so happy we can just tell people to use delays to avoid leaks :)
17:06 paulg I'm trying to fix up your fork so that it'll be accepted by the maintainer
17:06 paulg but im stuck writing the test casde
17:06 paulg *case
17:08 sri allright, you know how circular references in closures happen?
17:08 paulg yes
17:08 sri my $foo = Foo->new; $foo->do_stuff(sub { $foo->more_stuff });
17:08 paulg my $d; $d = deferred; $d->then(sub {$d});
17:08 sri lets assume the closure is stored in the hash based object $foo
17:09 sri ok, fieldhash allows us to store the closure outside of the object
17:09 sri $foo would be partially an inside-out object
17:10 paulg right
17:11 sri fieldhash is a little magic for inside-out objects that makes garbage collecting them easier
17:11 sri no need to handle your own DESTROY and stuff
17:11 sri which can be rather tedious
17:12 sri anyway, since the closure is stored outside the object, there is no circular reference
17:13 hasan Oleg: it just warned me. no crash.
17:13 sri aaah
17:13 sri paulg: this might make it easier to grok :) https://github.com/kraih/mojo/commit/c7518f0b865214d39eaeb2372b8efa12cb3d9e55
17:14 sri that was the commit that introduced fieldhash
17:15 * sri had never heard of fieldhash before that either, nice little helper
17:15 paulg sri: I'm trying to compose the correct question bare with me
17:17 * sri loves this new android lollipop feature http://updates.html5rocks.com/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
17:22 paulg right in your foo example, presumably the \sub {$foo->more_stuff} will be stored in the field hash, while not traditionally cyclic, the reference count for $foo will remain at +1 until the sub itself is removed. if you undef/weaken $foo in the main scope, then the refcount would still be 1, $foo would remain for the esact same reason that it would without the fieldhash
17:23 paulg unless there is some mechanism that is weakening/discounting the refcount for the reference maintained by the closure
17:24 sri right, which is why we need to clean up manually
17:24 disputin1 joined #mojo
17:24 paulg find_cycle would be blind to this, but the cyclic reference would still be there
17:24 sri https://github.com/kraih/promises-perl/commit/f8743be5299ec0f0e9753bb7e420a1523d34d94d#diff-6e06e50cfd87304efd275f9a8a4b5239R163
17:25 sri once the promise is resolved it can be garbage collected
17:25 sri this is the reason the same trick wouldn't work with supplies for example
17:25 disputin joined #mojo
17:25 sri (in perl6 terms)
17:26 sri or observables (in more generic terms)
17:27 sri that's the good thing about promises, they always end up fulfilled or rejected
17:33 paulg right im mostly with you, a bit of brain lock happening around removing the reference manually working anyway (which is where my first test passes even on the old version) bear with me...
17:33 meshl joined #mojo
17:35 paulg oh on the other hand I found a genuine leak for sure... check out: https://github.com/kraih/promises-perl/blob/f8743be5299ec0f0e9753bb7e420a1523d34d94d/lib/Promises/Deferred.pm#L125
17:36 paulg net result is that calling $d->then() without an error handler causes the whole object to leak
17:36 sri oh, that is possible
17:37 paulg I wrote a test and fixed it, I'll included it in my pull request
17:37 sri _notify needs to actually happen
17:38 paulg yes, I beleive its ok once its resolved/_notified
17:51 jamesaxl joined #mojo
17:51 sh4 joined #mojo
17:54 denis_boyun joined #mojo
18:01 risugg joined #mojo
18:03 risugg_ joined #mojo
18:09 paulg sri: so I still can't come up with a test which fails on stevan's branch, still this is my best attempt https://gist.github.com/og01/208a620258e624039dae
18:10 paulg only problem is that it passes with the current version aswell....
18:11 paulg find_cycle is not part of the test there
18:12 denis_boyun joined #mojo
18:18 hasan I often get this one here: Mojo::Reactor::Poll: Read failed: Can't call method "req" on an undefined value at lib/lib/perl5/Mojolicious/Controller.pm line 217.
18:18 hasan when using DBI (DBD::Pg). what could this mean?
18:23 marcus joined #mojo
18:33 hasan I've run many queries to my database and I get following message: "failed: FATAL:  remaining connection slots are reserved for non-replication superuser connections at lib/lib/perl5/Mojolicious/Plugin/PgAsync/Db.pm line 18."
18:33 hasan I know there is a option for postgresql on how many connections are allowed, etc.
18:34 hasan but could it be that this also means that I forget to close the database connections after I open them?
18:53 disputin joined #mojo
18:59 hasan ok I fixed it by removing a $self->render(..) after a $self->continue in my ioloop delay.
19:00 sugar joined #mojo
19:04 sh4 joined #mojo
19:09 paulg sri: /win 4
19:10 paulg sorry
19:12 Vytas joined #mojo
19:14 neyasov__ joined #mojo
19:14 sri paulg: /fail
19:15 * sri is slowly cleaning up Minion::Backend::Pg
19:17 d4rkie joined #mojo
19:17 meshl joined #mojo
19:24 sri bpmedley: btw. the whole "id in (?, ?, ?, ...)" dance is not necessary
19:24 sri ->query('...where id = any (?)', \@values)
19:25 sri gotta love data strucutres in postgres
19:28 tianon that's shiny
19:31 Eke- joined #mojo
19:42 tempire I call shenanigans.
19:42 tempire I don't think the limited edition actually has glitter on it.
19:45 sri totally has
19:45 sri even has a glitter raptor on the shoulder
19:47 sri although i don't get the hate for gold glitter
19:49 sri oooh
19:49 * sri now knows how to do dynamic intervals in postgres too
19:49 sri \o/
19:50 mr_fribble joined #mojo
19:50 sri ->query("...and finished < (now() - (interval '1 second' * ?))", $seconds);
19:51 sri you can multiply intervals
19:51 sri bpmedley: see, we never have to use the client side time :D
19:56 risugg joined #mojo
19:57 mst sri: interval ?", "$seconds seconds"
19:58 disputin joined #mojo
20:04 sri mst: syntax error at or near "$1"
20:05 sri "LINE 3:      and finished < (now() - interval $1)"
20:06 dvinciguerra joined #mojo
20:10 mst sri: hrm. I could've sworn there was some way to do that
20:20 dod joined #mojo
20:21 sri and now i need a clever update statement
20:22 sri the jobs table has a worker field, which contains the id of a row in the workers table, which may or may not exist
20:22 sri if it doesn't exist i want to update the job row to the state failed
20:27 mst that doesn't sound complicated
20:27 mst UPDATE jobs SET state = 'failed' WHERE NOT EXISTS (SELECT 1 FROM workers WHERE workers.id = jobs.workers_id)
20:28 sri my update-fu is a little weak still, looks like i got some more reading to do :)
20:28 sri oh, that looks almost too easy Oo
20:33 sri looks like it just works :o
20:34 sri mst++
20:35 sri one error took me a minute to figure out though :)
20:35 sri "could not determine polymorphic type because input has type "unknown""
20:35 sri i wrote to_json('Worker went away') instead of to_json('Worker went away'::text)
20:41 berov joined #mojo
20:51 ashimema is there a recommended way to use json web tokens in Mojo?
21:15 dvinciguerra joined #mojo
21:29 bwf joined #mojo
21:31 tempire Hmm.
21:31 tempire Material UI looks interesting
21:31 tempire http://material-ui.com/
21:39 hernan604 their demo only seems to work on chrome
21:39 hernan604 :~
21:39 mst people use other browsers than chrome?
21:40 * genio glares at you IE people
21:50 hernan604 mst: i prefer firefox
21:55 zivester joined #mojo
22:08 zivester joined #mojo
22:48 basic6 joined #mojo
22:55 zivester joined #mojo
23:17 Adura joined #mojo
23:19 disputin joined #mojo
23:19 bowtie joined #mojo
23:23 KindOne clear
23:24 jb360 left #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary