main.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // SiYuan - Refactor your thinking
  2. // Copyright (c) 2020-present, b3log.org
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. //go:build !mobile
  17. package main
  18. import (
  19. "github.com/siyuan-note/siyuan/kernel/cache"
  20. "github.com/siyuan-note/siyuan/kernel/job"
  21. "github.com/siyuan-note/siyuan/kernel/model"
  22. "github.com/siyuan-note/siyuan/kernel/server"
  23. "github.com/siyuan-note/siyuan/kernel/sql"
  24. "github.com/siyuan-note/siyuan/kernel/util"
  25. )
  26. func main() {
  27. util.Boot()
  28. model.InitConf()
  29. go server.Serve(false)
  30. model.InitAppearance()
  31. sql.InitDatabase(false)
  32. sql.InitHistoryDatabase(false)
  33. sql.InitAssetContentDatabase(false)
  34. sql.SetCaseSensitive(model.Conf.Search.CaseSensitive)
  35. sql.SetIndexAssetPath(model.Conf.Search.IndexAssetPath)
  36. model.BootSyncData()
  37. model.InitBoxes()
  38. model.LoadFlashcards()
  39. util.LoadAssetsTexts()
  40. util.SetBooted()
  41. util.PushClearAllMsg()
  42. job.StartCron()
  43. go model.AutoGenerateFileHistory()
  44. go cache.LoadAssets()
  45. go util.CheckFileSysStatus()
  46. model.WatchAssets()
  47. model.WatchEmojis()
  48. model.HandleSignal()
  49. }