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

IRC log for #mojo, 2017-03-18

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

All times shown according to UTC.

Time Nick Message
01:09 aborazmeh joined #mojo
01:12 marty joined #mojo
01:21 tchaves joined #mojo
01:22 marty joined #mojo
01:37 marty joined #mojo
02:01 marty joined #mojo
02:37 asarch joined #mojo
02:46 kaare joined #mojo
02:53 mtj joined #mojo
02:53 mtj joined #mojo
03:35 noganex joined #mojo
03:43 tchaves joined #mojo
04:30 sh14 joined #mojo
05:04 dboehmer joined #mojo
05:24 aborazmeh joined #mojo
06:54 khfeng joined #mojo
07:27 ooo joined #mojo
07:36 ooo i have the following script: http://paste.opensuse.org/90833381 - the time, e.g. "datetime" : "2017-03-18T08:26:01" doesn't change seconds (because it's cached somehow?), how can i always get an actual datetime output?
07:48 prg joined #mojo
08:22 noganex_ joined #mojo
08:30 coolo ooo: do not use has but a plain sub
08:40 Vandal joined #mojo
08:48 ooo coolo: sub date { $dt->datetime }; # doesn't work for me either (if i curl get the url a few times on after the other)
08:50 dod joined #mojo
09:00 irqq joined #mojo
09:25 coolo ooo: because $dt is a static variable
09:25 coolo sub date { DateTime->now(time_zone => 'local') }
09:46 kes joined #mojo
09:52 kes Hi, may someone give me an advice. It this a good idea to pass into the model current controller when I want to restrict data returned to current user?
09:52 kes Just like this:
09:52 kes http://paste.scsys.co.uk/557537
09:58 rshadow joined #mojo
10:07 jabberwok joined #mojo
10:09 ooo joined #mojo
10:39 Kage joined #mojo
10:40 Kage Hi all.  Is there a simple way to detect inside the app whether Morbo or Hypno are being used?
10:40 Kage I'm looking to use https://metacpan.org/pod/Mojolicious::Plugin::SetUserGroup but I need to detect if Morbo is in use since it apparently crashes Morbo
11:43 coolo kes: better pass the current user to the model instead of the controller
11:57 kes is there a way to get current controller from plugin?
11:57 kes coolo: http://paste.scsys.co.uk/557538
12:31 batman Kage: no, there isn't.
12:34 batman Kage: the synopsis has some ideas on how to load it on the right time
12:36 rshadow joined #mojo
13:21 aborazmeh joined #mojo
13:47 dod joined #mojo
13:48 someguy joined #mojo
13:49 someguy If I want a thing to be alive for the life of a request, is it ok for me to shove it in $tnx, or should i be using the stash?
14:09 marty joined #mojo
14:41 sri stash
14:42 sri funny you mention it though, i've been thinking about data storage in the transaction recently
14:43 sri because of this http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Streaming-multipart-uploads
14:44 sri we have many events that can do stuff while the request is still being processed
14:44 sri but no place to store the resulting data
14:48 kes What would be best approach to access helper methods from plugin?
14:48 kes This? $self->app->renderer->get_helper( $helper_name )->...
14:53 sri guess i'll make a --no-repair flag for the minion worker command
14:53 batman kes: $app->somehelper()
14:54 sri slow repair was really annoying last week when i wanted to deploy an update to my minion tasks quickly
14:54 sri but i guess i should differentiate between no repair and no repair on worker startup
14:55 sri hmm
14:55 jberger --fast-startup ?
14:55 sri yea
14:55 someguy --the-site-is-down-get-back-to-work
14:56 sri and -r gets removed, so you always have to write out --remove, for safety
14:56 jberger --get-going-^%$@#% , but of course you have to be careful about shell escaping that one
14:57 jberger sri: I can agree with needing to be explicit about --remove
14:58 kes batman: thank you
14:58 * jberger tries to work up the effort to start preparing his taxes
15:02 sri think i like -f, --fast-start
15:05 jberger -f almost carries the right meaning
15:05 jberger "force start"
15:05 * sri nods
15:05 jberger even if that isn't what it actually means
15:11 sri now that i think about it
15:11 sri i guess repair should actually happen in a background process
15:13 coolo tell that my garage :)
15:16 sri :)
15:17 sri there is no way i'll make that work anytime soon though... guess it will be part of the periodic jobs todo issue https://github.com/kraih/minion/issues/24
15:21 marty joined #mojo
15:29 marty joined #mojo
15:29 PryMar56 joined #mojo
15:31 lluad joined #mojo
15:32 rshadow joined #mojo
15:39 rshadow joined #mojo
16:27 sh14 joined #mojo
16:54 mmp_ is it necessary for hot-restarted hypnotoad instances exit its original master process?
16:54 mmp_ this means after a hot restart the root pid changes, and is then owned by init. makes it difficult/impossible to use something like supervisord without hacks
16:58 Grinnz yes, hot restart requires to start a new master
16:58 Grinnz systemd can follow this, with the changes made to ordering a while back
16:59 mmp_ is it *necessary* though? i tried reading the code but couldnt trace the flow from a USR2
17:00 Grinnz yes -- the whole point is so you can load new versions of your code, mojolicious modules, even perl itself
17:03 Grinnz i mean, it's not necessary to use hot restart, you can just stop and start it instead, but that interrupts requests
17:03 mmp_ ive built a simple process manager around the hot restart
17:03 mmp_ im just saying that might make more sense to live in hypnotoad itself
17:04 Grinnz nothing can persist through a hot restart in the same process, or libraries won't be reloaded
17:04 mmp_ you dont understand
17:04 mmp_ hypnotoad could act as both a manager and a server
17:05 mmp_ a manager would spawn a server which would be responsible for actually serving
17:05 Grinnz then both would have to restart for a hot restart
17:05 mmp_ sigusr2 to the manger proxies that sigusr2 to the server
17:05 mmp_ manager never dies
17:05 Grinnz which makes it pointless
17:05 mmp_ what?
17:05 mmp_ why?
17:06 Grinnz you mean an entirely separate process that just monitors the pid?
17:06 mmp_ the manager in itself is decoupled. the server would be a separate process of hypnotoad
17:06 mmp_ yes
17:06 Grinnz i'm not sure what that would buy you over a pidfile
17:07 mmp_ im essentially talking about server::starter
17:08 Grinnz you are free to use whatever process management you want, but there would probably need to be a really good reason to introduce the complication of an extra management process in core, when init scripts and systemd already use the pidfile fine
17:09 mmp_ I suppose
17:10 mmp_ perhaps what I am asking for is actually for supervisord to not need a process to be foregrounded to be managed, ie using a pidfile instead
17:10 mmp_ pushing the responsiblity in the wrong direction
17:10 Grinnz i don't know anything about supervisord but this issue does sound familiar
17:10 sri correct, if there's two equally good solutions we pick the one that's easier to implement
17:12 sri and i'd say the fact that you can upgrade everything with our implementation is an advantage over a supervisor that can never be upgraded without downtime
17:13 mmp_ sri: well, you can send arbitrary signals to processeses with supervisord
17:13 mmp_ https://github.com/Supervisor/supervisor/blob/master/supervisor/pidproxy.py
17:13 mmp_ ive modified this to kill -0 hypnotoads pid instead of waitpid, it seems to be doing the job ok
17:14 sri don't see how that relates to the discussion
17:15 mmp_ oh, you meant supervisor in the 'a manager process inside hypnotoad itself' sense, not supervisord. disregard
17:15 sri yes
17:51 marty joined #mojo
18:54 marty joined #mojo
18:58 stryx` joined #mojo
19:10 irqq joined #mojo
19:59 marty joined #mojo
20:18 irqq_ joined #mojo
20:30 castaway joined #mojo
20:35 castaway joined #mojo
20:57 rshadow joined #mojo
22:16 marty joined #mojo
22:45 sri looks like more people don't like how unpersonal i respond to issues
22:45 sri so from now on instead of prioritizing fast responses, i will not respond at all to issues that i don't personally care about
22:46 sri that means the community will have to take more responsibility
22:46 sri for future reference, from now on i will not feel personally responsible for getting all issues closed anymore
22:48 sri show me how it's done
22:49 pink_mist :( I love how unpersonal you respond to issues - sometimes I disagree with your response, but I've always been grateful it's there
22:49 pink_mist I think the way you've handled it is the best I've seen it handled in any project ever
22:50 pink_mist I strive (but often fail) to emulate your handling of issues in fact
22:54 someguy "the mean man gave me free software and then said he wouldn't fix it for nothing at top priority"
22:58 sri someone on the core team didn't like my language and suggested it should be optimized
22:58 sri but i don't have the time to handle every pull request then, so i hope that person will step up and lead by example
23:01 sri i guess some folks like quick responses (including me), while others prefer to wait for a more personal response
23:02 sri if personal responses are better for recruiting contributers (as has been suggested), i guess we can try that for a year or so
23:04 sri jberger, batman, marcus, tempire, crab: fyi
23:07 stryx` joined #mojo
23:17 sri also https://github.com/kraih/mojo/issues/1071
23:19 marcus sri: Like the backends idea. Faster reloading == more better
23:21 marcus I guess the mac would want FSEvents
23:46 irqq joined #mojo

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