Add Job System (#656)
* Add Job System * Remove testing stuff * changelog * plugin work * Convert a couple more jobs * simplify callback * assert * Logging changes and rendezvous perf * changelog * sb segment viewed job * clear cache, and few changes * Lint fix * a couple more jobs * reduce rendezvous in web server * refactor * Lint fix * no message * test shutdown * comment * free fields --------- Co-authored-by: github-action linter <githubaction@githubaction.com>
This commit is contained in:
1 parent
45983a67af
commit
d70a07049a
74 files changed
+1090
-298
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import "pkg:/components/JobSystem/Jobs.bs"
|
||||
import "pkg:/components/JobSystem/JobSystem.bs"
|
||||
import "pkg:/components/Services/SponsorBlock/Notifications/SponsorBlockNotificationUtils.bs"
|
||||
import "pkg:/components/Services/SponsorBlock/SponsorBlockService.bs"
|
||||
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||
import "SponsorBlockSegmentAction.bs"
|
||||
import "VideoPlayer.bs"
|
||||
|
||||
@@ -213,11 +213,13 @@ namespace SponsorBlock
|
||||
end function
|
||||
|
||||
function SendSkippedSectionEvent(segmentId as string)
|
||||
if m.sponsorSkipEventTask <> invalid
|
||||
m.sponsorSkipEventTask.cancel = true
|
||||
if m.sponsorSkipEventJob <> invalid
|
||||
m.sponsorSkipEventJob.cancel = true
|
||||
end if
|
||||
|
||||
m.sponsorSkipEventTask = AsyncTask.Start(Tasks.SponsorBlockSegmentViewedTask, { segmentId: segmentId })
|
||||
callback = JobSystem.CreateCallback()
|
||||
JobSystem.QueueJob(m.jobQueue, Jobs.SponsorBlockSegmentViewedJob, { segmentId: segmentId }, callback)
|
||||
m.sponsorSkipEventJob = callback
|
||||
end function
|
||||
|
||||
end namespace
|
||||
Reference in new issue
Block a user