Skip to content
This repository has been archived by the owner on Nov 17, 2024. It is now read-only.

Commit

Permalink
refactore: add debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
segadora committed Nov 7, 2024
1 parent 4b39fd3 commit be5537e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,17 @@ func (solarAssistant *SolarAssistant) updateWorkModeSchedule(c *gin.Context) {
log.Printf("browser path: %s", path)

u := launcher.New().Bin(path).MustLaunch()
log.Println("a")
browser := rod.New().ControlURL(u).MustConnect()
log.Println("b")

defer browser.MustClose()
log.Println("c")

page := browser.MustPage(solarAssistant.url + "/power")

log.Println("d")

page.MustWaitStable()

if page.MustElement(".heading").MustText() == "Sign in" {
Expand Down
1 change: 1 addition & 0 deletions solar_assistant_browser_automation_api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ FROM --platform=${BUILD_ARCH:-linux/amd64} golang:1.23 AS builder

WORKDIR /go/src/github.com/segadora/solar-assistant-browser-automation

RUN echo v1.0.0
RUN git clone https://github.com/segadora/solar-assistant-browser-automation.git .

COPY . .
Expand Down

0 comments on commit be5537e

Please sign in to comment.