Merge branch 'x/gorm' into x/sqlc

r/paopao-ce-pro
Michael Li 1 year ago
commit 693ef1fc66
No known key found for this signature in database

@ -12,7 +12,7 @@ Server: # 服务设置
ReadTimeout: 60 ReadTimeout: 60
WriteTimeout: 60 WriteTimeout: 60
Features: Features:
Default: ["Web", "Frontend:EmbedWeb", "Zinc", "LocalOSS", "MySQL", "BigCacheIndex", "LoggerZinc", "Friendship", "Followship"] Default: ["Web", "Frontend:EmbedWeb", "Meili", "LocalOSS", "MySQL", "BigCacheIndex", "LoggerFile", "Friendship", "Followship"]
Develop: ["Base", "MySQL", "BigCacheIndex", "Meili", "Sms", "AliOSS", "LoggerMeili", "OSS:Retention"] Develop: ["Base", "MySQL", "BigCacheIndex", "Meili", "Sms", "AliOSS", "LoggerMeili", "OSS:Retention"]
Demo: ["Base", "MySQL", "Option", "Zinc", "Sms", "MinIO", "LoggerZinc", "Migration"] Demo: ["Base", "MySQL", "Option", "Zinc", "Sms", "MinIO", "LoggerZinc", "Migration"]
Slim: ["Base", "Sqlite3", "LocalOSS", "LoggerFile", "OSS:TempDir"] Slim: ["Base", "Sqlite3", "LocalOSS", "LoggerFile", "OSS:TempDir"]

@ -41,7 +41,7 @@ services:
# - paopao-network # - paopao-network
redis: redis:
image: redis/redis-stack:7.0.6-RC8 image: redis/redis-stack:7.2.0-RC3
restart: always restart: always
ports: ports:
- 6379:6379 - 6379:6379
@ -51,33 +51,33 @@ services:
networks: networks:
- paopao-network - paopao-network
zinc: # zinc:
image: public.ecr.aws/zinclabs/zinc:latest # image: bitbus/zincsearch:latest
user: root # user: zincsearch
restart: always
ports:
- 4080:4080
volumes:
- ./custom/data/zinc/data:/data
environment:
ZINC_FIRST_ADMIN_USER: admin
ZINC_FIRST_ADMIN_PASSWORD: admin
DATA_PATH: /data
networks:
- paopao-network
# meili:
# image: getmeili/meilisearch:v1.2
# restart: always # restart: always
# ports: # ports:
# - 7700:7700 # - 4080:4080
# volumes: # volumes:
# - ./custom/data/meili/data:/meili_data # - ./custom/data/zinc/data:/data
# environment: # environment:
# - MEILI_MASTER_KEY=paopao-meilisearch # ZINC_FIRST_ADMIN_USER: admin
# ZINC_FIRST_ADMIN_PASSWORD: admin
# DATA_PATH: /data
# networks: # networks:
# - paopao-network # - paopao-network
meili:
image: getmeili/meilisearch:v1.3
restart: always
ports:
- 7700:7700
volumes:
- ./custom/data/meili/data:/meili_data
environment:
- MEILI_MASTER_KEY=paopao-meilisearch
networks:
- paopao-network
# pyroscope: # pyroscope:
# image: pyroscope/pyroscope:latest # image: pyroscope/pyroscope:latest
# restart: always # restart: always
@ -107,7 +107,7 @@ services:
depends_on: depends_on:
- db - db
- redis - redis
- zinc - meili
# modify below to reflect your custom configure # modify below to reflect your custom configure
volumes: volumes:
- ./config.yaml.sample:/app/paopao-ce/config.yaml - ./config.yaml.sample:/app/paopao-ce/config.yaml

@ -14,9 +14,7 @@ var (
) )
type bigCacheTweetsCache struct { type bigCacheTweetsCache struct {
name string bc *bigcache.BigCache
version *semver.Version
bc *bigcache.BigCache
} }
func (s *bigCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) { func (s *bigCacheTweetsCache) getTweetsBytes(key string) ([]byte, error) {

@ -5,6 +5,7 @@
package cache package cache
import ( import (
"context"
"time" "time"
"github.com/allegro/bigcache/v3" "github.com/allegro/bigcache/v3"
@ -28,7 +29,7 @@ func NewBigCacheIndexService(ips core.IndexPostsService, ams core.AuthorizationM
c.MaxEntrySize = 10000 c.MaxEntrySize = 10000
c.Logger = logrus.StandardLogger() c.Logger = logrus.StandardLogger()
bc, err := bigcache.NewBigCache(c) bc, err := bigcache.New(context.Background(), c)
if err != nil { if err != nil {
logrus.Fatalf("initial bigCahceIndex failure by err: %v", err) logrus.Fatalf("initial bigCahceIndex failure by err: %v", err)
} }

Loading…
Cancel
Save