Skip to content

Commit

Permalink
增强内核稳定性 #597
Browse files Browse the repository at this point in the history
  • Loading branch information
Soltus committed Mar 26, 2024
1 parent a19ba26 commit e481348
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: docker/setup-qemu-action@v2

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
Expand All @@ -65,4 +65,4 @@ jobs:
repository: soltus/sillot # 这是 docker hub 的不是 github 的
readme-filepath: ./.github/README.md
short-description: ${{ github.event.repository.description }}
enable-url-completion: true
enable-url-completion: false
2 changes: 1 addition & 1 deletion app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"7": "Remove notebook [%s] path [%s] failed: %s",
"8": "Check update failed",
"9": "\uD83D\uDE80 A new version is available, please browse the release announcement %s",
"10": "Is the latest version",
"10": "Is the latest version %s",
"11": "\uD83D\uDCE2 系統公告:<a target='_blank' href='%s'>%s</a>",
"12": "Query asset failed [%s]",
"13": "Cannot create a file starting with .",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"7": "Eliminar libreta [%s] ruta [%s] falló: %s",
"8": "Comprobar la actualización falló",
"9": "\uD83D\uDE80 Una nueva versión está disponible, por favor, busque el anuncio de lanzamiento %s",
"10": "Es la última versión",
"10": "Es la última versión %s",
"11": "\uD83D\uDCE2 Anuncio del sistema: <a target='_blank' href='%s'>%s</a>",
"12": "Fallo en la consulta de activos [%s]",
"13": "No se puede crear un archivo que empiece por .",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"7": "La suppression du carnet de notes [%s] path [%s] a échoué : %s",
"8": "La vérification de la mise à jour a échoué",
"9": "\uD83D\uDE80 Une nouvelle version est disponible, veuillez consulter l'annonce de la version %s",
"10": "C'est la dernière version",
"10": "C'est la dernière version %s",
"11": "\uD83D\uDCE2 Annonce système : <a target='_blank' href='%s'>%s</a>",
"12": "Échec de la requête asset [%s]",
"13": "Impossible de créer un fichier commençant par .",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/zh_CHT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@
"7": "在筆記本 [%s] 下刪除 [%s] 失敗:%s",
"8": "檢查更新失敗",
"9": "\uD83D\uDE80 有新版本可用,請瀏覽發佈公告 %s",
"10": "已是最新版",
"10": "已是最新版 %s",
"11": "\uD83D\uDCE2 系統公告:<a target='_blank' href='%s'>%s</a>",
"12": "查詢資料檔失敗 [%s]",
"13": "無法建立 . 開頭的文件",
Expand Down
2 changes: 1 addition & 1 deletion app/appearance/langs/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,7 @@
"7": "在笔记本 [%s] 下删除 [%s] 失败:%s",
"8": "检查更新失败",
"9": "\uD83D\uDE80 有新版本可用,请浏览发布公告 %s",
"10": "已是最新版",
"10": "已是最新版 %s",
"11": "\uD83D\uDCE2 系统公告:<a target='_blank' href='%s'>%s</a>",
"12": "查询资源文件失败 [%s]",
"13": "无法创建 . 开头的文件",
Expand Down
2 changes: 1 addition & 1 deletion app/src/mobile/settings/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export const initAbout = () => {
if(networkServeElement.checked){
window.JSAndroid?.requestPermissionActivity("Battery","注意:后台稳定伺服会消耗额外电量");
}
exitSiYuan();
window.JSAndroid?.restartSillotAndroid();
});
});
const tokenElement = modelMainElement.querySelector("#token") as HTMLInputElement;
Expand Down
1 change: 1 addition & 0 deletions app/src/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ interface Window {
requestPermissionActivity(id: string, Msg: string): void
requestPermission(id: string, Msg: string): boolean
exitSillotAndroid(): void
restartSillotAndroid(): void
savePictureByURL(uri: string): void
// sillot extend end
returnDesktop(): void
Expand Down
3 changes: 2 additions & 1 deletion app/stage/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ <h1 style="color: var(--b3-theme-primary);filter: invert(1) drop-shadow(2px 1px
const {ipcRenderer} = require('electron')
ipcRenderer.send('siyuan-quit', window.location.port)
} catch (e) {
window.JSAndroid?.exitSillotAndroid()
if ((window.webkit && window.webkit.messageHandlers) || window.JSAndroid) {
window.location.href = 'siyuan://api/system/exit'
} else {
Expand Down Expand Up @@ -538,7 +539,7 @@ <h1 style="color: var(--b3-theme-primary);filter: invert(1) drop-shadow(2px 1px
try {
const {ipcRenderer} = require('electron')
ipcRenderer.on('siyuan-save-close', (event, close) => {
exitSiYuan()
window.JSAndroid ? exitSillotAndroid() : exitSiYuan()
})
await ipcRenderer.invoke("siyuan-init", {
languages: {{.trayMenuLangs}},
Expand Down
7 changes: 0 additions & 7 deletions kernel/mobile/kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,3 @@ func SetTimezone(container, appDir, timezoneID string) {
}
time.Local = z
}

// Sillot extend
func SetBiometricPass(code string) {
util.BiometricPass = code
}

// Sillot extend end
7 changes: 7 additions & 0 deletions kernel/model/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,13 @@ func PurgeRepo() (err error) {
return
}

if stat == nil {
stat = &entity.PurgeStat{} // 避免 stat.Indexes 空指针导致崩溃
logging.LogErrorf("stat is nil after repo.Purge")
// return err
// return errors.New("stat is nil after repo.Purge")
}

deletedIndexes := stat.Indexes
deletedObjects := stat.Objects
deletedSize := humanize.Bytes(uint64(stat.Size))
Expand Down
2 changes: 1 addition & 1 deletion kernel/model/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func CheckUpdate(showMsg bool) {

_ver := strings.ReplaceAll(ver, "-sillot", "")
_ver = strings.ReplaceAll(_ver, "v", "")
release := "https://yy-ac.github.io/Hi-Windom/Sillot/release/v" + _ver
release := "https://github.com/Hi-Windom/Sillot/releases/tag/" + ver
var msg string
var timeout int
if isVersionUpToDate(_ver) {
Expand Down
1 change: 0 additions & 1 deletion kernel/util/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
)

var WrongAuthCount int
var BiometricPass string

func NeedCaptcha() bool {
return 3 < WrongAuthCount
Expand Down

0 comments on commit e481348

Please sign in to comment.