1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Open DB only when needed

Former-commit-id: 2809fdfbbe56c1697a8a4699a11608fdefc33ef1 [formerly f3c48188157385a09b4aa8377727808faea640fd] [formerly f2ce94925b7a89b53d4fae7d7bef000174a9b7d2 [formerly 3dc0ea7524]]
Former-commit-id: 6207c2b06c010c4056cdda511262ef5e66b938d7 [formerly 755e934bab151bb526062c0fd0f2378fe1100c90]
Former-commit-id: a97aaa6e4146f587e3446a93caa4a2ad2bdb9e0c
This commit is contained in:
Zack Scholl 2016-03-14 15:26:55 -04:00
parent 5721604187
commit bb0f0845a5

View File

@ -380,6 +380,8 @@ func deletePage(c *gin.Context) {
} }
func listEverything() string { func listEverything() string {
Open(RuntimeArgs.DatabaseLocation)
defer Close()
everything := `| Title | Current size | Changes | Total Size | | everything := `| Title | Current size | Changes | Total Size | |
| --------- |-------------| -----| ------------- | ------------- | | --------- |-------------| -----| ------------- | ------------- |
` `
@ -403,6 +405,8 @@ func listEverything() string {
} }
func dumpEverything() { func dumpEverything() {
Open(RuntimeArgs.DatabaseLocation)
defer Close()
err := os.MkdirAll("dump", 0777) err := os.MkdirAll("dump", 0777)
if err != nil { if err != nil {
fmt.Println("Already exists") fmt.Println("Already exists")