Early telegram integrations

This commit is contained in:
2022-09-14 22:54:51 +08:00
parent 534bc70f0f
commit 9b48f2ee50
8 changed files with 65 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ package utils
import (
"bytes"
"io"
"log"
"os"
"path/filepath"
"time"
@@ -20,6 +21,7 @@ func CacheStream( path string, readStream func() ( io.ReadCloser, error ), expir
f, err := os.Open( path )
if err == nil {
defer f.Close()
log.Printf( "Using cache: %s", path )
writeBuff := bytes.NewBuffer( []byte{} )
_, err = io.Copy( writeBuff, f )
if err == nil {