Skip to content

Commit

Permalink
fix: ci broken (#338)
Browse files Browse the repository at this point in the history
Co-authored-by: fusikai <fusikai@douyu.tv>
  • Loading branch information
linthan and fusikai authored Feb 1, 2023
1 parent 80d00cb commit 111a74e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -26,6 +28,7 @@ jobs:
cd assets
yarn install
yarn build
git checkout -- ./assets/yarn.lock
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
Expand All @@ -38,12 +41,10 @@ jobs:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go env
go get -v -t -d ./...
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
Expand Down Expand Up @@ -73,7 +74,6 @@ jobs:
id: vars
run: |
echo "::set-output name=file_name::$(ls dist/juno_*linux* |cut -c 6-)"
- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v5.9
with:
Expand All @@ -84,4 +84,4 @@ jobs:
directory: dist
dockerfile: ./cmd/juno-admin/Dockerfile
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
password: ${{ secrets.GHCR_TOKEN }}
5 changes: 1 addition & 4 deletions internal/pkg/service/user/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,11 @@ func (u *user) Delete(item db.User) (err error) {

func (u *user) GetAppViewHistory(uid uint32) (resp []db.AppViewHistory, err error) {
resp = make([]db.AppViewHistory, 0)

ids := make([]uint32, 0)

if err = u.DB.Table("app_view_history").Select("max(id) as id").Where("uid = ?", uid).Group("aid").Pluck("id", &ids).Error; err != nil {
return
}

if err = u.DB.Table("app_view_history").Select("*").Where("id in (?)", ids).Limit(10).Find(&resp).Error; err != nil {
if err = u.DB.Table("app_view_history").Select("*").Where("id in (?)", ids).Order("created_at desc").Limit(10).Find(&resp).Error; err != nil {
return
}

Expand Down

0 comments on commit 111a74e

Please sign in to comment.