check tcp when insert telegram to db

This commit is contained in:
w1ndyb0y
2021-02-01 17:29:01 +08:00
parent fe1a8169e6
commit 133c80088c
+2
View File
@@ -66,6 +66,7 @@ func InitDb(file string, init bool) error {
} }
func InsertTelegram(teleString string) { func InsertTelegram(teleString string) {
if Tcp {
getWriteLock() getWriteLock()
db := getDb() db := getDb()
defer db.Close() defer db.Close()
@@ -88,6 +89,7 @@ func InsertTelegram(teleString string) {
Log.Info("telegram saved ", zap.Int64("id", id)) Log.Info("telegram saved ", zap.Int64("id", id))
} }
} }
}
func LoadUnprocessed() { func LoadUnprocessed() {
Log.Info("loading telegram") Log.Info("loading telegram")