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

IRC log for #mojo, 2016-12-30

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

All times shown according to UTC.

Time Nick Message
00:10 howitdo joined #mojo
01:00 sugar joined #mojo
01:19 PopeFelix joined #mojo
01:22 aborazmeh joined #mojo
01:23 sri jberger: this exists btw. http://mojolicious.org/perldoc/Mojo/Server/Daemon#close_idle_connections
01:23 sri was actually expecting someone to request an addition to Mojo::UserAgent
01:23 sri but i guess it would work just fine in Mojo::Pg too
01:47 sugar joined #mojo
02:52 dantti_laptop|2 joined #mojo
03:22 asarch joined #mojo
03:47 noganex joined #mojo
05:04 dboehmer joined #mojo
05:35 howitdo joined #mojo
06:15 inokenty-w joined #mojo
06:27 jberger Indeed, and from a testing perspective once startup has completed you can be reasonably sure that all of the existing connections are idle
06:52 Vandal joined #mojo
07:16 parv joined #mojo
07:22 parvx joined #mojo
08:44 rshadow joined #mojo
08:52 rshadow joined #mojo
08:55 osfabibisi joined #mojo
09:03 dod joined #mojo
09:10 dod joined #mojo
09:11 stryx` joined #mojo
09:23 AndrewIsh joined #mojo
09:47 parvx left #mojo
10:01 ashimema joined #mojo
10:11 howitdo joined #mojo
10:24 dod joined #mojo
10:26 rshadow joined #mojo
10:35 sugar joined #mojo
10:55 sword_smith joined #mojo
11:03 jamesaxl joined #mojo
11:08 sri jberger: https://github.com/kraih/mojo-pg/compare/v2.31...master
11:14 sugar joined #mojo
11:30 tchaves joined #mojo
11:43 sugar joined #mojo
11:56 ladnaV joined #mojo
11:59 Vandal joined #mojo
12:12 mishanti1 Benchmarking is fun.
12:13 mishanti1 Hypnotoad is chooching along just fine. :)
12:25 kes joined #mojo
13:14 kes I know, that the application will be run under /api/v1 path. what shoud I use in startup: Mount plugin or just detour?
13:14 kes and what is the right way?
13:32 kes I just should use ->partial(1)
13:38 dexteruk|2 joined #mojo
13:51 sri jberger: well, now i've changed everything again ;p
14:00 jamesaxl joined #mojo
14:13 blonewolfs joined #mojo
14:27 gryphon joined #mojo
14:57 asarch joined #mojo
15:46 sh14 joined #mojo
15:53 kes and why "partial" not named as "prefix"?? it will look more better to my mind.
16:09 jamesaxl joined #mojo
16:23 kaare joined #mojo
16:26 kes Why $c->match->endpoint->render renders: /api/v instead despite on $c->param( 'api' ) is 1?
16:27 kes I expect: /api/v1
16:42 disputin joined #mojo
17:11 howitdo joined #mojo
17:16 howitdo joined #mojo
17:21 henq joined #mojo
17:48 disputin joined #mojo
17:58 kes If url_for is called whiout arguments logs are flooded by warning: Use of uninitialized value $_[1] in hash element
17:58 kes at https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Routes.pm#L56
17:59 pink_mist I would suggest not doing that then
18:00 sugar joined #mojo
18:03 kes it is documented as OK
18:03 kes http://mojolicious.org/perldoc/Mojolicious/Controller#url_for
18:03 pink_mist all of those versions have at least one argument
18:04 pink_mist err, wait, I looked at the wrong thing
18:04 pink_mist never mind
18:04 kes Even default welcome.html.ep has url_for without arguments
18:38 jamesaxl joined #mojo
19:11 nibiru joined #mojo
19:25 rshadow joined #mojo
19:26 sugar joined #mojo
19:39 vicash Can Hypnotoad be used to run a Minion::Worker ? I want to be able to restart a minion worker using systemd and hypnotoad already starts the mojo app. is the commandline the same as hypnotoad ./myapp minion worker ? Will it read the same configuration ?
19:44 disputin joined #mojo
19:49 dod joined #mojo
19:59 noganex_ joined #mojo
20:05 jberger vicash why not just set up another systemd task to start your minion workers?
20:06 jberger and to answer your direction question, no, the hypnotoad script doesn't invoke the same command system (well, not in the same way) as running the script directly
20:07 jberger hypnotoad is in some sense already a wrapper around the `prefork` command
20:07 jberger your minion workers don't need to start a web server to do their jobs (hopefully!)
20:08 jberger one of the steps in "leveling up" in mojo is learning that the app itself isn't just a webapp
20:08 jberger starting the app with a web server is just one of the thing you can do with it
20:08 jberger starting the app to spawn minion workers is another
20:09 jberger etc etc for different commands
20:09 jberger (or even embedding the app in other scripts)
20:10 jberger and often the reason to do that is to reuse the same configuration, libraries, helpers etc
20:10 jberger but no need to think in terms of a webserver
20:11 kes How to disable Inactivity timeout while debugging tests? it takes time to run code step-by-step in debugger. And if it finnally everything is OK I got 'Inactifity timeout' and test fail (
20:14 rshadow joined #mojo
20:21 jberger kes: you could use a hook early on to set the inactivity timeout to 0
20:22 jberger hook after_build_tx => sub { shift->inactivity_timeout(0) };
20:22 kes i have found link in google group
20:22 kes ;$t->ua->inactivity_timeout( 0 );
20:22 jberger err, no that won't work, that's a tx not a controller
20:22 jberger this is a user agent or a server?
20:22 kes and this help
20:23 kes seems it was the user agent side
20:23 jberger the server side has a timeout too
20:23 jberger keep an eye out for that if it becomes a problem
20:23 kes but I have no errors. Maybe in development mode it is off?
20:24 jberger I can't really help you, I never use the debugger for this kind of thing
20:24 jberger I mostly debug via log and print
20:24 jberger especially in non-blocking code
20:44 rshadow joined #mojo
20:53 sri jberger: i keep going back and forth between using a method or an attribute for temp schema
20:53 sri not sure how to do it
20:53 kes can not find sharp line of code, but when $t->ua->max_redirects( 1 ) and redirection occur. This redirection do not setup 'Referer' header
21:04 kes hm... it is even removed: https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L99
21:06 jberger sri: that's a tough call
21:08 sri and i just noticed that $pg->auto_migrate(1)->migrations->active triggers automatic migrations
21:08 sri no clue if that's right
21:08 sri some interesting interactions
21:08 jberger maybe a slightly different idea
21:09 jberger what about a "temporary" flag or so, then it just works with the search_path
21:09 jberger presumably the first element of the search path
21:09 jberger hmmm, ok, I see where that breaks down already
21:10 sri was about to say
21:10 howitdo joined #mojo
21:10 sri snd it doesn't help with the problems at all
21:10 jberger that just clearly makes it an attribute
21:10 sri i tend towards making it a method since there is less surprises
21:10 jberger but no, doesn't win the war, just a battle
21:11 jberger yeah, it "does stuff"
21:11 jberger so that feels like a methd
21:11 jberger +o
21:11 rshadow joined #mojo
21:14 disputin joined #mojo
21:20 kes jberger: may you help me please. Whey 'Referer' is removed from next request?
21:21 * jberger ¯_(ツ)_/¯
21:23 kes at this commit: e7cb50ae it was removed only for 301, 307 status codes
21:24 kes and at this: ce643c6d it is removed for all
21:27 kes after redirection Referer should be present like any browser does. should not?
21:27 rshadow joined #mojo
21:48 kes jberger: After redirection we should check that 'Referer' header exists: https://github.com/kraih/mojo/blob/master/t/mojo/transactor.t#L657
21:49 jberger I don't know, if you'd like to request a feature, we need RFCs to back it up
21:49 jberger and presumably corroboration from other non-browser clients
21:49 jberger like curl or wget
21:54 lluad Referer isn't sent by some of the more privacy-oriented users. Breaking stuff because it's missing seems like <insulting comparison here>.
21:57 lluad (In general. It's a common trick to deter hotlinking of images.)
21:59 jberger it would be possible to implement yourself
22:01 jberger $ua->on(start => sub { my $tx = shift; return unless my $previous = $tx->previous; $tx->req->headers->referer($previous->req->url); });
22:01 jberger # untested, off the top of my head
22:02 jberger it would be: my $tx = pop; actually
22:13 kes jberger: http://stackoverflow.com/a/23410059/4632019
22:13 kes I look for option like ";auto"
22:13 kes curl -vL --referer ";auto" site.domain/redirect_page
22:14 jberger I gave you the code to do it yourself, if you'd like to propose a feature, by all means
22:15 jberger I'm assuming it would be an attribute that lives on the Transactor
22:15 jberger it would need tests and documentation, both there and in the Guides probably
22:15 jberger and then it would be a vote of the core dev team
22:15 jberger I'm neutral right now
22:15 kes jberger: thank you very much for that. But I supply example from other non-browser clients as you ask
22:16 jberger that is a minimal requirement to even proceed, are you saying that because curl has it as an option that we are required to implement code for you?
22:17 jberger thank you for the supplied example, it tells me that curl does not do the behavior you seek by default
22:17 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Contributing#CONTRIBUTING-CODE
22:19 jberger sorry, I've gotten a little snippy here
22:19 jberger let me say it another way
22:20 jberger Since curl does not implement this behavior by default, I don't think we could consider Mojo's behavior a bug
22:20 kes this is the feature request
22:20 jberger I think that a feature like this could be considered, but this would need someone to write the code
22:20 jberger its not my itch to scratch
22:20 kes I will not write. All my tries was failed )
22:21 jberger then I'm not sure who will write it
22:21 jberger you are welcome to try to recruit someone to your cause
22:22 kes if you allow to publish this as feature request on github...
22:22 kes maybe someone will see and implement
22:23 jberger inactive bug/features on github get closed relatively quickly (as you know)
22:23 jberger maybe propose it on the mailing list?
22:23 jberger the fact that any previous PRs didn't get accepted doesn't imply anything about future ones
22:24 jberger it might be wise to take the temperature of the core team before spending time on it
22:24 jberger and I could help review with you before submitting an actual PR if you'd like
22:25 kes I will open issue on my fork. It will remember me about that. I will not close.
22:28 kes jberger: thank you for suggested workaround
22:31 kes Please review this piece of code: https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Controller.pm#L166. Can not give '0' name for template
22:35 jberger that looks like a bug, please open a detailed bug on the github
22:59 jberger hmmmm so I do worry about security implications about Referer being added
22:59 jberger there's a fair amount of research that would have to happen
23:07 sri please research the temp_schema stuff first
23:08 jberger Oh yeah, I'm not saying I'm going to do that research
23:26 sugar joined #mojo
23:45 mishanti1 Now here is a fun fact: I just booked a round trip Norway<->Japan for myself and my partner and paid approximately US$165. If I fly from Bergen to our capital Oslo I easily pay that amount for a round trip (45 minute flight).

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