Skip to content
代码片段 群组 项目
未验证 提交 c9ca9f71 编辑于 作者: Bharat Raju's avatar Bharat Raju 提交者: GitHub
浏览文件

Using getAllSessionPartitionInfoForSession instead of getSessionPartitionInfo...

Using getAllSessionPartitionInfoForSession instead of getSessionPartitionInfo for more stability (#1294)

JIRA: ZAPP-1350
上级 fad2a60e
No related branches found
No related tags found
无相关合并请求
......@@ -181,7 +181,7 @@ async function ensurePackagesAndPopulateSessionOptions(
} else {
sessionPartitionIndex++
return querySession
.getSessionPartitionInfo(db, sessionId, options.partitions)
.getAllSessionPartitionInfoForSession(db, sessionId)
.then((sessionPartitionInfo) =>
queryPackage.insertSessionPackage(
db,
......@@ -221,7 +221,10 @@ async function ensurePackagesAndPopulateSessionOptions(
.getPackagesByType(db, dbEnum.packageType.genTemplatesJson)
.then((rows) => {
let packageId
if (selectedGenTemplatePackages?.length > 0) {
if (
selectedGenTemplatePackages &&
selectedGenTemplatePackages.length > 0
) {
selectedGenTemplatePackages.forEach((gen) => {
if (gen) {
packageId = gen
......@@ -291,7 +294,7 @@ async function ensurePackagesAndPopulateSessionOptions(
} else {
sessionPartitionIndex++
return querySession
.getSessionPartitionInfo(db, sessionId, options.partitions)
.getAllSessionPartitionInfoForSession(db, sessionId)
.then((sessionPartitionInfo) =>
queryPackage.insertSessionPackage(
db,
......@@ -341,7 +344,7 @@ async function ensurePackagesAndPopulateSessionOptions(
} else {
sessionPartitionIndex++
return querySession
.getSessionPartitionInfo(db, sessionId, options.partitions)
.getAllSessionPartitionInfoForSession(db, sessionId)
.then((sessionPartitionInfo) =>
queryPackage.insertSessionPackage(
db,
......@@ -359,11 +362,6 @@ async function ensurePackagesAndPopulateSessionOptions(
}
if (promises.length > 0) await Promise.all(promises)
sessionPartitionInfo = await querySession.getSessionPartitionInfo(
db,
sessionId,
options.partitions
)
// We read all the packages.
let packages = await queryPackage.getSessionPackagesWithTypes(db, sessionId)
// Now we create promises with the queries that populate the
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册