Skip to content

Instantly share code, notes, and snippets.

@jackpinto
Last active January 4, 2018 13:57
Show Gist options
  • Save jackpinto/77df4d39fb42a29c357cbfb2138e1680 to your computer and use it in GitHub Desktop.
Save jackpinto/77df4d39fb42a29c357cbfb2138e1680 to your computer and use it in GitHub Desktop.
HangFire log
SELECT TOP (1000) q.[Id], q.[JobId], q.[Name], q.[Reason], q.[CreatedAt], q.[Data]
FROM [SimplesNacional.Task].[HangFire].[State] q
INNER JOIN
(
SELECT
MAX(x.id) stateid,
x.jobid
FROM [SimplesNacional.Task].[HangFire].[State] x
WHERE x.name = 'Failed'
AND x.jobid IN
(
SELECT
j.id
FROM [SimplesNacional.Task].[HangFire].[Job] j
WHERE j.statename = 'Failed'
)
GROUP BY x.jobid
) xxx
ON q.id = xxx.stateid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment