mirror of
https://github.com/schollz/cowyo.git
synced 2023-08-10 21:13:00 +03:00
Open DB only when needed
This commit is contained in:
parent
b767dd0352
commit
3dc0ea7524
@ -380,6 +380,8 @@ func deletePage(c *gin.Context) {
|
||||
}
|
||||
|
||||
func listEverything() string {
|
||||
Open(RuntimeArgs.DatabaseLocation)
|
||||
defer Close()
|
||||
everything := `| Title | Current size | Changes | Total Size | |
|
||||
| --------- |-------------| -----| ------------- | ------------- |
|
||||
`
|
||||
@ -403,6 +405,8 @@ func listEverything() string {
|
||||
}
|
||||
|
||||
func dumpEverything() {
|
||||
Open(RuntimeArgs.DatabaseLocation)
|
||||
defer Close()
|
||||
err := os.MkdirAll("dump", 0777)
|
||||
if err != nil {
|
||||
fmt.Println("Already exists")
|
||||
|
Loading…
Reference in New Issue
Block a user