From 4e1be9bee68d665d78f59c2567d3f373850c2c6f Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Sun, 4 Dec 2022 00:00:40 +0800 Subject: [PATCH] fix: async init aria2 to optimize start duration --- internal/bootstrap/aria2.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/bootstrap/aria2.go b/internal/bootstrap/aria2.go index 1d165127..60017dda 100644 --- a/internal/bootstrap/aria2.go +++ b/internal/bootstrap/aria2.go @@ -6,9 +6,11 @@ import ( ) func InitAria2() { - _, err := aria2.InitClient(2) - if err != nil { - //utils.Log.Errorf("failed to init aria2 client: %+v", err) - utils.Log.Infof("Aria2 not ready.") - } + go func() { + _, err := aria2.InitClient(2) + if err != nil { + //utils.Log.Errorf("failed to init aria2 client: %+v", err) + utils.Log.Infof("Aria2 not ready.") + } + }() }