From 4f450ea8e058deff0d9c47686fd0f20f33d106e2 Mon Sep 17 00:00:00 2001 From: feiniks <36756310+feiniks@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:08:29 +0800 Subject: [PATCH] Delete RepoTokenPeerInfo when del repo (#684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 杨赫然 --- .github/workflows/golangci-lint.yml | 4 ++-- server/repo-mgr.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fd260fc5..f20e8073 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: stable + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: stable + go-version: "1.22" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/server/repo-mgr.c b/server/repo-mgr.c index fb00f89f..205c00c0 100644 --- a/server/repo-mgr.c +++ b/server/repo-mgr.c @@ -611,7 +611,9 @@ seaf_repo_manager_del_repo (SeafRepoManager *mgr, } seaf_db_statement_query (mgr->seaf->db, - "DELETE FROM RepoUserToken WHERE repo_id = ?", + "DELETE t.*, i.* FROM RepoUserToken t, " + "RepoTokenPeerInfo i WHERE t.token=i.token AND " + "t.repo_id=?", 1, "string", repo_id); seaf_db_statement_query (mgr->seaf->db,