Skip to content

Feature: Updates System Support#37

Merged
paulotruta merged 1 commit intomainfrom
updates-system
Jul 4, 2024
Merged

Feature: Updates System Support#37
paulotruta merged 1 commit intomainfrom
updates-system

Conversation

@paulotruta
Copy link
Member

No description provided.

@paulotruta paulotruta self-assigned this Jun 25, 2024
Comment on lines +431 to +446
// Configure the service and start it
cmd := exec.Command("sh", "/home/system/components/updater/run.sh", "--check")
stdout, err := cmd.StdoutPipe()
if err != nil {
panic(err)
}
scanner := bufio.NewScanner(stdout)
err = cmd.Start()
if err != nil {
panic(err)
}
for scanner.Scan() {
// fmt.Println(scanner.Text())
text := scanner.Text()
fmt.Println(text)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to handle not being able to run the updater. We don't want to crash in that case but gracefully exit.
Would be maybe useful to use the return_val, err := pattern commonly found in go built-in methods to return a proper error back to whatever runs CheckUpdates(). This will also allow us to mark these tasks as errors (and that thus reflected in the dashboard / api)

@paulotruta
Copy link
Member Author

paulotruta commented Jun 26, 2024

Still needs some cleanup work, namely better error handling and abstraction + re-use of currently repetitive code.

@paulotruta paulotruta merged commit a8b1da4 into main Jul 4, 2024
@paulotruta paulotruta deleted the updates-system branch July 4, 2024 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant