|
my code as it standsC# code:
e: i literally just added the using and Task.Run blocks around the existing try-catch that was there. e2: i forgot to include the try-catch for the json parsing, but you get the idea HoboMan fucked around with this message at 20:39 on Oct 11, 2018 |
# ? Oct 11, 2018 20:32 |
|
|
# ? Dec 14, 2024 17:10 |
he has an exception programmed in the a.i. to override the blockade of his suicide
|
|
# ? Oct 11, 2018 20:32 |
|
jeffery posted:he has an exception programmed in the a.i. to override the blockade of his suicide
|
# ? Oct 11, 2018 20:44 |
|
brand engager posted:is that dude a bot and/or having a psychotic break Por qué no los dos
|
# ? Oct 11, 2018 20:52 |
your speakin about urself dumbass
|
|
# ? Oct 11, 2018 20:53 |
|
HoboMan posted:my code as it stands has your logger got any sort of session dependency? async threads don't share/inherit session so that can just silently dump stuff there's something like "log the current session user Id in the trace" when there is no session user id i had a very similar use case with emails where the factor was that the attachment to the mail could take more than the web timeout to generate, so the mail would kick off in another thread and the user would get a "sending mail" response into their browser but they might then get an email going "this timed out after x seconds" 5 mins later Edit: just realised this makes no sense as the start trace is logged. For my case I actually gave up using tasks because I had some weird issues and just used a manually created thread instead. Powerful Two-Hander fucked around with this message at 21:09 on Oct 11, 2018 |
# ? Oct 11, 2018 21:03 |
|
HoboMan posted:my code as it stands I feel like I oughta know this better after having hosed with C# for a minute, but Task.Run creates, starts, and returns a Task; if you were expecting an exception to propagate _out_ of your Task than I think you'd need to await the Task returned by Task.Run. It seems like the exception handling should happen regardless of whether you await the Task.
|
# ? Oct 11, 2018 21:05 |
|
Bet logger is getting disposed when the request completes, and the task is silently discarding an object disposed exception
|
# ? Oct 11, 2018 21:31 |
|
HoboMan posted:but i am also that guy!!! see thread title
|
# ? Oct 11, 2018 21:44 |
|
any exceptions logged in the windows event log?
|
# ? Oct 11, 2018 21:45 |
|
Night Shade posted:Bet logger is getting disposed when the request completes, and the task is silently discarding an object disposed exception Yeah I'm thinking this, as well.
|
# ? Oct 11, 2018 21:46 |
|
HoboMan posted:my code as it stands Task.ContinueWith should be what you want
|
# ? Oct 11, 2018 22:07 |
|
Zlodo posted:phonetically Q is butt in french so it makes sense lol current q report: working with dates feels really nice but q is hella weakly typed so this is biting me a lot like check this out code:
|
# ? Oct 13, 2018 00:25 |
|
huh?
|
# ? Oct 13, 2018 03:00 |
|
Symbolic Butt posted:lol this goes well beyond "weakly typed" and into "insanely typed"
|
# ? Oct 13, 2018 03:09 |
|
implicitly converts int to remote code execution, that’s even more impressively cracked than c++
|
# ? Oct 13, 2018 03:56 |
|
redleader posted:this goes well beyond "weakly typed" and into "insanely typed" it’s just automatic promotion of an arbitrary integer to a pointer, what’s the worst that could happen
|
# ? Oct 13, 2018 09:01 |
|
we did it https://twitter.com/LuigiThirty/status/1051017321941270528
|
# ? Oct 13, 2018 09:03 |
|
HoboMan posted:my code as it stands you should look to use HostingEnvironment.QueueBackgroundWorkItem as described in this lovely blog post https://blogs.msdn.microsoft.com/webdev/2014/06/04/queuebackgroundworkitem-to-reliably-schedule-and-run-background-processes-in-asp-net/ which just happens to be about sending email too any time you're doing "long running" work in ASP.NET (you never should) you're subject to the AppPool being recycled and all that poo poo. MS realized people were not going to figure out this is a bad idea so they added this
|
# ? Oct 13, 2018 11:44 |
|
Alternatively just fart out to a service like sendgrid. May not be an option, but their free plan is quite generous
|
# ? Oct 13, 2018 11:48 |
|
AWWNAW posted:you should look to use HostingEnvironment.QueueBackgroundWorkItem lmao at the first sentence in that being "there are loads of stack overflow questions about this" IDK maybe that's because you guys embed this stuff in random blog posts where it's impossible to find?
|
# ? Oct 13, 2018 12:18 |
|
Is that the one where if you negate it the code gets run async?
|
# ? Oct 13, 2018 16:21 |
|
ColTim posted:Is that the one where if you negate it the code gets run async? yes!
|
# ? Oct 13, 2018 16:29 |
|
- Scheduled work items are not guaranteed to ever execute, once the app pool starts to shut down, QueueBackgroundWorkItem calls will not be honored. lol. deal with this by fixing the mail server if you possibly can. otherwise if you want things to actually get delivered it sounds like you need to store the pending emails in a persistent queue.
|
# ? Oct 13, 2018 17:00 |
|
brap posted:- Scheduled work items are not guaranteed to ever execute, once the app pool starts to shut down, QueueBackgroundWorkItem calls will not be honored. Yeah, I don't see what this QueueBackgroundWorkItem actually gets you if the calls won't be honored when the AppPool shuts down. Like, I already had that just spinning up background workers.
|
# ? Oct 13, 2018 20:03 |
|
the difference between QBWI and some random threadpool worker is that ASP.NET is aware of stuff queued by the former, and will notify background items about impending app pool recycles etc and give them a grace period before it kills them. this gives the worker an opportunity to gracefully stop doing its thing with a normal threadpool worker, ASP.NET doesn't know of its existence and will just kill it immediately on app pool recycle i also think there's a difference in how uncaught exceptions are handled - maybe QBWI won't kill the process on unhandled exceptions, while the same thing in a normal thread will? not sure on this point though QBWI is a wrapper around HostingEnvironment.RegisterObject by people who know what they are doing. this is weird low level ASP.NET poo poo that most people have no business loving about with naturally, RegisterObject is used in some very important bits of our codebase redleader fucked around with this message at 01:57 on Oct 14, 2018 |
# ? Oct 14, 2018 01:53 |
|
or just read this which is basically the canonical "why you shouldn't run stuff in background threads in ASP.NET" and is far better than my lovely post. note that it was written before QBWI was introduced, but is still an excellent reference
|
# ? Oct 14, 2018 01:56 |
|
ctps: hosed around and got Azure Devops working at work building a deploying some dumb little toy project At the risk of being shaggar, it's pretty good but also clearly a work in progress
|
# ? Oct 15, 2018 22:56 |
|
ctps: somehow I’ve ended up writing a perl script
|
# ? Oct 16, 2018 01:29 |
|
Soricidus posted:ctps: somehow I’ve ended up writing a perl script shameful.
|
# ? Oct 16, 2018 01:30 |
|
i think i had one college class that required writing perl scripts and that's the last i've seen of it lol
|
# ? Oct 16, 2018 01:32 |
|
my experience with perl is thus: At least it isn't php
|
# ? Oct 16, 2018 01:35 |
|
i took a perl class at intel with someone whose entire programming history until that point was test assembly not like, your normal kind of assembly that a compiler spits out, but problem statements like "exercise this pin" and writing raw x86 asm to hit that condition. so every little thing where the professor was trying to explain, say, flow control with a for() loop, this guy would break down in tears at how much heavy lifting the language was doing for him for a while my pseudocode would come out half a step away from perl, it's kinda nice that i've devolved down into C
|
# ? Oct 16, 2018 01:38 |
|
JawnV6 posted:so every little thing where the professor was trying to explain, say, flow control with a for() loop, this guy would break down in tears at how much heavy lifting the language was doing for him joy or frustration?
|
# ? Oct 16, 2018 02:18 |
|
mod saas posted:joy or frustration? bittersweet, lil from column A, lil from column B his job presumably still had a lot of straight-line assembly or he may have, like me, figured out perl spits out asm p. good
|
# ? Oct 16, 2018 02:25 |
|
ctps: convinced work that it would be a good idea for me to learn swift and get a trained up on our iOS app. I only vaguely remember mvvm and the iOS devs do not like how much of a functional weenie f# has made me. Feelin' extra terrible rn
|
# ? Oct 16, 2018 04:56 |
|
people that don’t appreciate functional programming are bad people
|
# ? Oct 16, 2018 10:40 |
|
i liked perl
|
# ? Oct 16, 2018 13:47 |
|
from what I have been told: Perl is good if you want to write a script that uses regex or does a lot of math. I think that’s about it.
|
# ? Oct 16, 2018 13:56 |
|
|
# ? Dec 14, 2024 17:10 |
|
ratbert90 posted:from what I have been told: i mean, python can do that too and isn't nearly as ugly
|
# ? Oct 16, 2018 13:59 |