spme fixes
This commit is contained in:
@@ -7,7 +7,7 @@ COPY ./laniakea ./laniakea
|
|||||||
COPY ./plugins ./plugins
|
COPY ./plugins ./plugins
|
||||||
COPY ./utils ./utils
|
COPY ./utils ./utils
|
||||||
COPY ./main.go ./
|
COPY ./main.go ./
|
||||||
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X utils.BuildTime=$(date -u +%Y-%m-%d_%H:%M:%S)" -v -o /usr/local/bin/kurumi ./
|
RUN --mount=type=cache,target=/go/pkg/mod CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X kurumibot/utils.BuildTime=$(date \"+%H:%M:%S %d.%m.%Y\")" -v -o /usr/local/bin/kurumi ./
|
||||||
|
|
||||||
FROM alpine:3.23 AS runner
|
FROM alpine:3.23 AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ func (rep *RPRepository) GetUser(id int64) (*RPUser, error) {
|
|||||||
}
|
}
|
||||||
func (rep *RPRepository) UpdateUser(user *RPUser) error {
|
func (rep *RPRepository) UpdateUser(user *RPUser) error {
|
||||||
_, err := rep.db.NamedExec(
|
_, err := rep.db.NamedExec(
|
||||||
"UPDATE rp_users SET selected_preset=:selected_preset, used_tokens=:used_tokens WHERE user_id=:user_id;",
|
"UPDATE rp_users SET selected_preset=:selected_preset, used_tokens=:used_tokens, user_prompt=:user_prompt WHERE user_id=:user_id;",
|
||||||
user,
|
user,
|
||||||
)
|
)
|
||||||
return err
|
return err
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -1,11 +1,9 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"kurumibot/database"
|
"kurumibot/database"
|
||||||
"kurumibot/laniakea"
|
"kurumibot/laniakea"
|
||||||
"kurumibot/plugins"
|
"kurumibot/plugins"
|
||||||
"kurumibot/utils"
|
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/joho/godotenv"
|
"github.com/joho/godotenv"
|
||||||
@@ -42,8 +40,6 @@ func main() {
|
|||||||
plugins.RegisterAdmin(bot)
|
plugins.RegisterAdmin(bot)
|
||||||
plugins.RegisterRP(bot)
|
plugins.RegisterRP(bot)
|
||||||
|
|
||||||
fmt.Printf("Build time: %s", utils.BuildTime)
|
|
||||||
|
|
||||||
defer bot.Close()
|
defer bot.Close()
|
||||||
bot.Run()
|
bot.Run()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ func (o *OpenAIAPI) DoRequest(url string, params any) ([]byte, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
if res.StatusCode == 504 || res.StatusCode == 400 {
|
if res.StatusCode == 504 || res.StatusCode == 400 || res.StatusCode == 502 {
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
return o.DoRequest(url, params)
|
return o.DoRequest(url, params)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user