mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🐛 Unable to switch the publish service between multiple workspaces https://github.com/siyuan-note/siyuan/issues/16587
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
0e0a64caa5
commit
e557e3bb68
1 changed files with 6 additions and 5 deletions
|
|
@ -35,10 +35,6 @@ var (
|
|||
|
||||
listener net.Listener
|
||||
transport = PublishServiceTransport{}
|
||||
proxy = &httputil.ReverseProxy{
|
||||
Rewrite: rewrite,
|
||||
Transport: transport,
|
||||
}
|
||||
)
|
||||
|
||||
func InitPublishService() (uint16, error) {
|
||||
|
|
@ -108,12 +104,17 @@ func closePublishListener() (err error) {
|
|||
|
||||
func startPublishReverseProxyService() {
|
||||
logging.LogInfof("publish service [%s:%s] is running", Host, Port)
|
||||
// 服务进行时一直阻塞
|
||||
|
||||
proxy := &httputil.ReverseProxy{
|
||||
Rewrite: rewrite,
|
||||
Transport: transport,
|
||||
}
|
||||
if err := http.Serve(listener, proxy); err != nil {
|
||||
if listener != nil {
|
||||
logging.LogErrorf("boot publish service failed: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
logging.LogInfof("publish service [%s:%s] is stopped", Host, Port)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue