Skip to content

Commit

Permalink
fix(sys-server): fix publish err when func or policy is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Dec 28, 2021
1 parent 8ccdec5 commit c1d6e2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/system-server/src/api/function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-07-30 10:30:29
* @LastEditTime: 2021-12-21 17:25:44
* @LastEditTime: 2021-12-28 20:37:17
* @Description:
*/

Expand Down Expand Up @@ -87,6 +87,8 @@ export async function publishFunctions(app: ApplicationStruct) {
})
.toArray()

if (ret.length === 0) return

// compile functions
const data = ret.map(fn => compileFunction(fn))

Expand Down
4 changes: 3 additions & 1 deletion packages/system-server/src/api/policy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @Author: Maslow<wangfugen@126.com>
* @Date: 2021-07-30 10:30:29
* @LastEditTime: 2021-12-07 14:59:23
* @LastEditTime: 2021-12-28 20:36:07
* @Description:
*/

Expand Down Expand Up @@ -55,6 +55,8 @@ export async function publishAccessPolicies(app: ApplicationStruct) {
})
.toArray()

if (ret.length === 0) return

// write policies to app db
const app_accessor = await getApplicationDbAccessor(app)
const session = app_accessor.conn.startSession()
Expand Down

0 comments on commit c1d6e2a

Please sign in to comment.