Skip to content

Commit

Permalink
refactor postProvision
Browse files Browse the repository at this point in the history
  • Loading branch information
algo7 committed Oct 13, 2023
1 parent 8f572e2 commit 21ef7f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions container_provisioner/api/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,21 @@ func postProvision(c *fiber.Ctx) error {
proxyContainers := containers.AcquireProxyContainer()

// Generate the container config
scrapeConfig := containers.ContainerConfigGenerator(scrapeMode, scrapeTargetName, url, uploadIdentifier, *proxyContainers.IPAddress, *proxyContainers.VPNRegion)
scrapeConfig := containers.ContainerConfigGenerator(scrapeMode, scrapeTargetName, url, uploadIdentifier, proxyContainers.IPAddress, proxyContainers.VPNRegion)

// Create the container
containerID := containers.CreateContainer(scrapeConfig)

// Start the scraping container via goroutine
go func() {
containers.Scrape(uploadIdentifier, scrapeTargetName, containerID)
database.ReleaseLock(*proxyContainers.ContainerID)
database.ReleaseLock(proxyContainers.LockKey)
}()

return c.Render("submission", fiber.Map{
"Title": "Algo7 TripAdvisor Scraper",
// "Message": fmt.Sprintf("Your request has been submitted. You will receive an email at %s when the data is ready", email),
"Message1": fmt.Sprintf("Your request has been submitted. VPN Region: %s", vpnRegionMsg),
"Message1": fmt.Sprintf("Your request has been submitted. VPN Region: %s", proxyContainers.VPNRegion),
"Message2": "You can check the progress of your request below",
"Message3": "Once it's done, you can return to the main page to download the data",
"ContainerId": containerID,
Expand Down

0 comments on commit 21ef7f1

Please sign in to comment.