mirror of
https://github.com/SukkaW/Surge.git
synced 2026-02-03 12:31:54 +08:00
Perf: run cpu intensive task with worker
This commit is contained in:
@@ -30,5 +30,9 @@ const getGorhillPublicSuffix = async () => {
|
||||
return gorhill;
|
||||
};
|
||||
|
||||
const getGorhillPublicSuffixPromise = getGorhillPublicSuffix();
|
||||
module.exports.getGorhillPublicSuffixPromise = getGorhillPublicSuffixPromise;
|
||||
/** @type {Promise<import('gorhill-publicsuffixlist').default | null>} */
|
||||
let gorhillPublicSuffixPromise = null;
|
||||
module.exports.getGorhillPublicSuffixPromise = () => {
|
||||
gorhillPublicSuffixPromise ||= getGorhillPublicSuffix();
|
||||
return gorhillPublicSuffixPromise;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user