1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-07 06:30:06 +00:00

feat: implement the logic for running python stored programs

This commit is contained in:
2022-08-16 15:51:37 +05:00
parent f736e67517
commit b06993ab9e
12 changed files with 235 additions and 20 deletions

View File

@@ -28,7 +28,8 @@ export enum LOG_FORMAT_MORGANType {
export enum RunTimeType {
SAS = 'sas',
JS = 'js'
JS = 'js',
PY = 'py'
}
export enum ReturnCode {
@@ -228,7 +229,7 @@ const verifyRUN_TIMES = (): string[] => {
const verifyExecutablePaths = () => {
const errors: string[] = []
const { RUN_TIMES, SAS_PATH, NODE_PATH, MODE } = process.env
const { RUN_TIMES, SAS_PATH, NODE_PATH, PYTHON_PATH, MODE } = process.env
if (MODE === ModeType.Server) {
const runTimes = RUN_TIMES?.split(',')
@@ -240,6 +241,10 @@ const verifyExecutablePaths = () => {
if (runTimes?.includes(RunTimeType.JS) && !NODE_PATH) {
errors.push(`- NODE_PATH is required for ${RunTimeType.JS} run time`)
}
if (runTimes?.includes(RunTimeType.PY) && !PYTHON_PATH) {
errors.push(`- PYTHON_PATH is required for ${RunTimeType.PY} run time`)
}
}
return errors