Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e517bbad0f
6 changed files with 12 additions and 7 deletions
|
@ -22,6 +22,7 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"math"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
@ -45,6 +46,8 @@ func echo(c *gin.Context) {
|
|||
} else {
|
||||
rawData = nil
|
||||
}
|
||||
c.Request.ParseForm()
|
||||
c.Request.ParseMultipartForm(math.MaxInt64)
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"Context": map[string]interface{}{
|
||||
|
|
|
@ -50,7 +50,7 @@ require (
|
|||
github.com/rqlite/sql v0.0.0-20221103124402-8f9ff0ceb8f0
|
||||
github.com/sashabaranov/go-openai v1.17.8
|
||||
github.com/shirou/gopsutil/v3 v3.23.10
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231124091823-9b5765d14aeb
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231125082301-edddcb1de16f
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
|
||||
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80
|
||||
github.com/siyuan-note/filelock v0.0.0-20231107122348-6ed75b0b525a
|
||||
|
|
|
@ -358,6 +358,8 @@ github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05Ut
|
|||
github.com/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231124091823-9b5765d14aeb h1:MJ7XvdmgaMqyYw0y0uHyRQTjhXIvRq8Q9bDnhLK4GEE=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231124091823-9b5765d14aeb/go.mod h1:qt8rUiTbSfM9+kilENizIB4pwido3BJd571GQkTv4XU=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231125082301-edddcb1de16f h1:RG6ap1PnZIPXVUFmCw/bxLiX6o/VGZwRjmSxBPQDXfE=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20231125082301-edddcb1de16f/go.mod h1:qt8rUiTbSfM9+kilENizIB4pwido3BJd571GQkTv4XU=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
|
||||
github.com/siyuan-note/eventbus v0.0.0-20230804030110-cf250f838c80 h1:XghjHKJd+SiL0DkGYFVC+UGUDFtnR4v9gkAbPeh9Eq8=
|
||||
|
|
|
@ -501,7 +501,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
|
|||
if !force {
|
||||
if Conf.Sync.Enabled && 3 != Conf.Sync.Mode &&
|
||||
((IsSubscriber() && conf.ProviderSiYuan == Conf.Sync.Provider) || conf.ProviderSiYuan != Conf.Sync.Provider) {
|
||||
syncData(true, false, false)
|
||||
syncData(true, false)
|
||||
if 0 != ExitSyncSucc {
|
||||
exitCode = 1
|
||||
return
|
||||
|
|
|
@ -1237,7 +1237,7 @@ func syncRepo(exit, byHand bool) (dataChanged bool, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
dataChanged = nil == beforeIndex || beforeIndex.ID != afterIndex.ID
|
||||
dataChanged = nil == beforeIndex || beforeIndex.ID != afterIndex.ID || mergeResult.DataChanged()
|
||||
|
||||
util.PushStatusBar(fmt.Sprintf(Conf.Language(149), elapsed.Seconds()))
|
||||
Conf.Sync.Synced = util.CurrentTimeMillis()
|
||||
|
|
|
@ -152,10 +152,10 @@ func BootSyncData() {
|
|||
}
|
||||
|
||||
func SyncData(byHand bool) {
|
||||
syncData(false, byHand, false)
|
||||
syncData(false, byHand)
|
||||
}
|
||||
|
||||
func syncData(exit, byHand, byWebSocket bool) {
|
||||
func syncData(exit, byHand bool) {
|
||||
defer logging.Recover()
|
||||
|
||||
if !checkSync(false, exit, byHand) {
|
||||
|
@ -192,7 +192,7 @@ func syncData(exit, byHand, byWebSocket bool) {
|
|||
connectSyncWebSocket()
|
||||
}
|
||||
|
||||
if 1 == Conf.Sync.Mode && !byWebSocket && nil != webSocketConn && Conf.Sync.Perception && dataChanged {
|
||||
if 1 == Conf.Sync.Mode && nil != webSocketConn && Conf.Sync.Perception && dataChanged {
|
||||
// 如果处于自动同步模式且不是又 WS 触发的同步,则通知其他设备上的内核进行同步
|
||||
request := map[string]interface{}{
|
||||
"cmd": "synced",
|
||||
|
@ -746,7 +746,7 @@ func connectSyncWebSocket() {
|
|||
data := result.Data.(map[string]interface{})
|
||||
switch data["cmd"].(string) {
|
||||
case "synced":
|
||||
syncData(false, false, true)
|
||||
syncData(false, false)
|
||||
case "kernels":
|
||||
onlineKernelsLock.Lock()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue