Skip to content

Commit

Permalink
kafka configuration poll records
Browse files Browse the repository at this point in the history
  • Loading branch information
anoopkarnik committed Oct 26, 2024
1 parent 2fab711 commit eeea44c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
timeout: 600
script: |
cd /home/ubuntu/saas-apps && sudo docker-compose pull
cd /home/ubuntu/saas-apps && sudo docker-compose rm -f
Expand Down
16 changes: 8 additions & 8 deletions apps/dashboard-app/app/actions/workflows/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ export const runPythonCode = async (code:string) => {
},
body: body,
}
try{
const res = await fetch(`${process.env.NEXT_PUBLIC_FLASK_WORKER_URL}/payload`, options)
const data = await res.json();
return {success: "Python code executed successfully", result: data}
}
catch (error) {
return {error: "Python code execution failed"}
}
const res = await fetch(`${process.env.NEXT_PUBLIC_FLASK_WORKER_URL}/payload`, options)
console.log('res',res)
if (!res.ok){
return {error: "Python code execution failed", result: res.text() + " " + res.status,success:"wtf"}
}
const data = await res.json();
return {success: "Python code executed successfully", result: data,error:""}

}
1 change: 1 addition & 0 deletions apps/flask-worker/app/main/services/kafka.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def consume_kafka_messages():
enable_auto_commit=False,
group_id='flask-kafka-group',
max_poll_interval_ms=600000,
max_poll_records=10,
value_deserializer=lambda x: json.loads(x.decode('utf-8'))
)
producer = KafkaProducer(
Expand Down

0 comments on commit eeea44c

Please sign in to comment.