Skip to content

Commit

Permalink
ci: remove runtime version override (#642)
Browse files Browse the repository at this point in the history
* ci: remove runtime version override

Signed-off-by: mikeee <[email protected]>

* fix: remove base64 decode for jobs api example

Signed-off-by: mikeee <[email protected]>

* fix(tests): update jobs api test

Signed-off-by: mikeee <[email protected]>

---------

Signed-off-by: mikeee <[email protected]>
Co-authored-by: Yaron Schneider <[email protected]>
  • Loading branch information
mikeee and yaron2 authored Nov 20, 2024
1 parent 87659bf commit e52d60c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate_examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
DAPR_INSTALL_URL: ${{ env.DAPR_INSTALL_URL }}
DAPR_CLI_VER: ${{ steps.outputs.outputs.DAPR_CLI_VER }}
DAPR_CLI_REF: ${{ steps.outputs.outputs.DAPR_CLI_REF }}
DAPR_RUNTIME_VER: 1.14.1
DAPR_RUNTIME_VER: ${{ steps.outputs.outputs.DAPR_RUNTIME_VER }}
CHECKOUT_REPO: ${{ steps.outputs.outputs.CHECKOUT_REPO }}
CHECKOUT_REF: ${{ steps.outputs.outputs.CHECKOUT_REF }}
DAPR_REF: ${{ steps.outputs.outputs.DAPR_REF }}
Expand Down
6 changes: 3 additions & 3 deletions examples/dist-scheduler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ expected_stdout_lines:
- 'Scheduler stream connected'
- 'schedulejob - success'
- 'job 0 received'
- 'extracted payload: {db-backup {my-prod-db /backup-dir}}'
- 'payload: {db-backup {my-prod-db /backup-dir}}'
- 'job 1 received'
- 'extracted payload: {db-backup {my-prod-db /backup-dir}}'
- 'payload: {db-backup {my-prod-db /backup-dir}}'
- 'job 2 received'
- 'extracted payload: {db-backup {my-prod-db /backup-dir}}'
- 'payload: {db-backup {my-prod-db /backup-dir}}'
- 'getjob - resp: &{prod-db-backup @every 1s 10 value:"{\"task\":\"db-backup\",\"metadata\":{\"db_name\":\"my-prod-db\",\"backup_location\":\"/backup-dir\"}}"}'
- 'deletejob - success'
Expand Down
13 changes: 2 additions & 11 deletions examples/dist-scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"log"
Expand Down Expand Up @@ -96,19 +95,11 @@ func main() {
var jobCount = 0

func prodDBBackupHandler(ctx context.Context, job *common.JobEvent) error {
var jobData common.Job
if err := json.Unmarshal(job.Data, &jobData); err != nil {
return fmt.Errorf("failed to unmarshal job: %v", err)
}
decodedPayload, err := base64.StdEncoding.DecodeString(jobData.Value)
if err != nil {
return fmt.Errorf("failed to decode job payload: %v", err)
}
var jobPayload api.DBBackup
if err := json.Unmarshal(decodedPayload, &jobPayload); err != nil {
if err := json.Unmarshal(job.Data, &jobPayload); err != nil {
return fmt.Errorf("failed to unmarshal payload: %v", err)
}
fmt.Printf("job %d received:\n type: %v \n typeurl: %v\n value: %v\n extracted payload: %v\n", jobCount, job.JobType, jobData.TypeURL, jobData.Value, jobPayload)
fmt.Printf("job %d received:\n type: %v \n payload: %v\n", jobCount, job.JobType, jobPayload)
jobCount++
return nil
}

0 comments on commit e52d60c

Please sign in to comment.