Use fibers when processing new revisions

Just have one fiber at the moment, but this will enable using fibers for
parallelism in the future.

Fibers seemed to cause problems with the logging setup, which was a bit odd in
the first place. So move logging to the parent process which is better anyway.
This commit is contained in:
Christopher Baines 2023-11-05 13:42:03 +00:00
parent f5acc60288
commit c3cb04cb80
6 changed files with 364 additions and 468 deletions

View file

@ -48,43 +48,37 @@
(mock
((guix-data-service jobs load-new-guix-revision)
setup-logging
(lambda (conn thunk)
(thunk)))
channel-derivations-by-system->guix-store-item
(lambda (store channel-derivations-by-system)
"/gnu/store/test"))
(mock
((guix-data-service jobs load-new-guix-revision)
channel-derivations-by-system->guix-store-item
(lambda (store channel-derivations-by-system)
"/gnu/store/test"))
extract-information-from
(lambda* (conn store guix-revision-id commit
guix-source store-path
#:key skip-system-tests?)
#t))
(mock
((guix-data-service jobs load-new-guix-revision)
extract-information-from
(lambda* (conn store guix-revision-id commit
guix-source store-path
#:key skip-system-tests?)
((guix-data-service model channel-instance)
insert-channel-instances
(lambda (conn guix-revision-id derivations-by-system)
#t))
(mock
((guix-data-service model channel-instance)
insert-channel-instances
(lambda (conn guix-revision-id derivations-by-system)
#t))
((guix channels)
channel-news-for-commit
(lambda (channel commit)
'()))
(mock
((guix channels)
channel-news-for-commit
(lambda (channel commit)
'()))
(match (enqueue-load-new-guix-revision-job
conn
(git-repository-url->git-repository-id conn "test-url")
"test-commit"
"test-source")
((id)
(process-load-new-guix-revision-job id)))))))))))
(match (enqueue-load-new-guix-revision-job
conn
(git-repository-url->git-repository-id conn "test-url")
"test-commit"
"test-source")
((id)
(process-load-new-guix-revision-job id))))))))))
(exec-query conn "TRUNCATE guix_revisions CASCADE")
(exec-query conn "TRUNCATE load_new_guix_revision_jobs CASCADE")