mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
factor out some shared code
This commit is contained in:
parent
657ce0f1a4
commit
e0e4791f72
5 changed files with 66 additions and 52 deletions
|
|
@ -7,7 +7,6 @@ import (
|
|||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
|
@ -156,12 +155,7 @@ func histservExportHandler(service *ircService, server *Server, client *Client,
|
|||
}
|
||||
|
||||
func histservExportAndNotify(service *ircService, server *Server, cfAccount string, outfile *os.File, filename, alertNick string) {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
server.logger.Error("history",
|
||||
fmt.Sprintf("Panic in history export routine: %v\n%s", r, debug.Stack()))
|
||||
}
|
||||
}()
|
||||
defer server.HandlePanic()
|
||||
|
||||
defer outfile.Close()
|
||||
writer := bufio.NewWriter(outfile)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue