HangfireIO / HangfireIO/Hangfire
PostgreSQL Batch execution of SqlCommand
- Dominant language
- C#
- Stars
- 10.1k
- Forks
- 1.8k
- Avg merge
- 1h 19m
- Merged PRs (30d)
- 1
Description
We do n’t have anyone to add a schedule.
How can i fix it. Help~!
MVC
Hangfire.AspNetCore (1.7.9)
Hangfire.PostgreSql (1.6.4.1)
```
services.AddHangfire(x =>
x.UsePostgreSqlStorage(conn));
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new DashboardNoAuthorizationFilter(), },
IgnoreAntiforgeryToken = true
});
```
Api Console
Hangfire.AspNetCore (1.7.9)
Hangfire.PostgreSql (1.6.4.1)
```
services.AddHangfire(x =>
x.UsePostgreSqlStorage(conn));
app.UseHangfireServer();
```
My sql data is empty.
https://imgur.com/cPiqZuM
https://imgur.com/gtcmaW0
Found that Hangfire two data tables execute SQL commands very frequently
hangfure.jobqueue => update
```
UPDATE ""hangfire"".""jobqueue""
SET ""fetchedat"" = NOW() AT TIME ZONE 'UTC'
WHERE ""id"" IN (
SELECT ""id""
FROM ""hangfire"".""jobqueue""
WHERE ""queue"" = ANY ($1)
AND ""fetchedat"" IS NULL
ORDER BY
CASE ""queue""
WHEN 'default' THEN 0
ELSE 1
END,
""fetchedat"", ""jobid""
LIMIT 1
)
```
hangfure.lock=> insert, delete
```
execute : DELETE FROM "hangfire"."lock" WHERE "resource" = $1 AND "acquired" < $2
parameters: $1 = 'HangFire:recurring-jobs:lock', $2 = '2020-05-07 01:50:13.220603'
execute : DELETE FROM "hangfire"."lock" WHERE "resource" = $1
parameters: $1 = 'HangFire:recurring-jobs:lock'
```
SqlCommand File
Delete
https://drive.google.com/file/d/1H8w0kPCbmXCegcYtzjnzTaFbJQQer0jt/view?usp=sharing
Insert
https://drive.google.com/file/d/1SQQAo_Z9BGhkQivcnJDGBMQPsHTfFAsR/view?usp=sharing
Update
https://drive.google.com/file/d/1aNJiTnutpB0UXrTZM37l126FZlpldbOg/view?usp=sharing
Contributor guide
Research direction
Start with the reported Hangfire.AspNetCore 1.7.9 and Hangfire.PostgreSql 1.6.4.1 configuration, including AddHangfire and UseHangfireServer. Review the linked SqlCommand examples and the PostgreSQL jobqueue and lock statements to determine whether they explain the missing scheduled jobs. Done should include a reproducible cause and a documented resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, postgresql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100