<FromGitter>
<Blacksmoke16> is there any use case for serializing null on specific properties vs all or no properties?
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 246 seconds]
chemist69 has quit [Ping timeout: 246 seconds]
chemist69 has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
livcd has joined #crystal-lang
Ring0` has quit [Quit: bb 0_o]
alex`` has joined #crystal-lang
f1reflyylmao has quit [Quit: bye fags]
f1refly has joined #crystal-lang
frojnd has quit [Ping timeout: 244 seconds]
gangstacat has quit [Ping timeout: 276 seconds]
gangstacat has joined #crystal-lang
<FromGitter>
<Blacksmoke16> im going with no for now
<FromGitter>
<j8r> I'm working on an experimental package manager
<FromGitter>
<Daniel-Worrall> Sometimes, what I don't like is how a hash access can return an error on an invalid key instead of returning a default value (like nil) β Have to do `if hash[key]?`
<FromGitter>
<nsuchy> Aside from updating the templates, this approach seems to work
<FromGitter>
<nsuchy> it's still a bit messy
<FromGitter>
<nsuchy> but less than before
<FromGitter>
<Daniel-Worrall> You probably want a method on User to check instead
<FromGitter>
<nsuchy> The reason we check if the service is disabled in the controller, and not the model is because Staff can pull a user's virtual machine and make changes regardless of if it's disabled, I suppose we could set a flag
<FromGitter>
<Daniel-Worrall> or idk
<FromGitter>
<nsuchy> this is, at least better than before
<FromGitter>
<Blacksmoke16> wait why not just do like (pseudo code) `BlestaUser.where("id in user_ids")`
<FromGitter>
<Blacksmoke16> then you just do 1 db query and inherently get an array back
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 265 seconds]
return0e has joined #crystal-lang
return0e_ has quit [Ping timeout: 276 seconds]
<FromGitter>
<fridgerator> I'm having an issue with Crystal resolving docker host names with an error: `Caused by: getaddrinfo: Temporary failure in name resolution (Socket::Addrinfo::Error)`
<FromGitter>
<fridgerator> Docker host name resolution has been an issue with crystal for a while now, has anyone else run into this issue, or have a workaround?
<FromGitter>
<Daniel-Worrall> How are you trying to resolve host names?
<FromGitter>
<Daniel-Worrall> Have you tried to resolve host names on not-crystal
<FromGitter>
<fridgerator> yes it work without crystal
<FromGitter>
<fridgerator> I have a docker service linked as `postgres`, and I can use that host name with other services. Even older Crystal versoins work.
<FromGitter>
<fridgerator> for instance I can `psql -h postgres`, works just fine
<FromGitter>
<stronny> what's the output of `$ dig postgres`
<FromGitter>
<fridgerator> there are discussions around this already, however its not really fixed
<FromGitter>
<stronny> what's listening on 127.0.0.11:53 udp? systemd-nameserverd?
<FromGitter>
<naqvis> from the error its evident that its `LibC` which is failing on DNS resolution.
<FromGitter>
<naqvis> might be code get run prior to orchestrator updating the `/etc/resolv.conf`
<FromGitter>
<Daniel-Worrall> 1) 0.0.11 is the docker resolver
<FromGitter>
<stronny> yeah, may be a race condition during cont startup
<FromGitter>
<stronny> how about modifying /etc/hosts inside the cont?
<FromGitter>
<naqvis> quick test could be run a simple crystal script to resolve service name, after bashing into container. the way you are running `psql`. if that still fails, that can rule-out race condition, and might be something off binding and/or invocation of LibC
<FromGitter>
<Daniel-Worrall> if it's a race condition, just put a depends_on in the compose
daemonwrangler has quit [Ping timeout: 245 seconds]
<FromGitter>
<Daniel-Worrall> That's what I ended up doing
<FromGitter>
<Daniel-Worrall> Initial timeout it hasn't expired yet, then just a subscribe/timeout on a loop
<FromGitter>
<Blacksmoke16> whoa what, sleep for 10 days?
mjblack has quit [Ping timeout: 240 seconds]
daemonwrangler has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> Twitch Webhooks
<FromGitter>
<Daniel-Worrall> They have a 10 day max expiry
<FromGitter>
<Daniel-Worrall> Actually, I may just need to use that Timer lib later because I'll need to work in unsubscribing
<FromGitter>
<Daniel-Worrall> so I'll need to cancel some timers mid-run
<FromGitter>
<Daniel-Worrall> so it doesn't just constantly subscribe even when I don't want it to
mjblack has joined #crystal-lang
<FromGitter>
<Blacksmoke16> was going to say wouldnt it be easier to like have the webhook hit some API endpoint
<FromGitter>
<Blacksmoke16> and depending on what you need to do with it, maybe enqueue it for some async worker to handle
<FromGitter>
<Daniel-Worrall> yeah, they don't notify on expiration
<FromGitter>
<Daniel-Worrall> They're sending the webhook to my route, and I'm acting on those, but I need to subscribe to the topics I want, then renew them every 10 days
<FromGitter>
<Daniel-Worrall> I'll probably just implement my own Timer class in the future instead
<FromGitter>
<Blacksmoke16> gotcha
<FromGitter>
<Daniel-Worrall> Saves on dependencies
<FromGitter>
<c-cube> ugh, now I really want a semaphore
<FromGitter>
<c-cube> to limit the concurrency
<FromGitter>
<didactic-drunk> would a countdownlatch suffice?
<FromGitter>
<c-cube> sure, but there's none in the stdlib, right?
<FromGitter>
<c-cube> this was very pleasant to write, even the testβ¦
hightower2 has joined #crystal-lang
tdc_ has joined #crystal-lang
tdc has quit [Ping timeout: 240 seconds]
tdc_ has quit [Quit: Leaving]
hightower2 has quit [Ping timeout: 240 seconds]
ht_ has quit [Remote host closed the connection]
<FromGitter>
<jwoertink> When I try to build crystal manually and run `make`, I get `dyld: Library not loaded: /usr/local/opt/libevent/lib/libevent-2.1.6.dylib`
<FromGitter>
<jwoertink> I'm not sure what in crystal needs this, but is there a way to specify a later version?
<FromGitter>
<tflem> Are there any Crystal podcasts yet?
<FromGitter>
<jwoertink> I don't know about podcasts, but there's crystalweekly.com
<FromGitter>
<jwoertink> which may mention some
<FromGitter>
<tflem> Nice, will check that out.
<FromGitter>
<jwoertink> `make clean crystal && make` seemed to fix my issue. Weird though.
<FromGitter>
<Daniel-Worrall> `!(a == b) || !(c == d)` you guys think this looks fine?#
<FromGitter>
<Daniel-Worrall> or is there a better way to test equality of 2 similar things
<FromGitter>
<Daniel-Worrall> objects, but not the same type
<FromGitter>
<Daniel-Worrall> The equiv is `!((a == b) && (c == d))` from w/e it's called