Skip to content

Commit

Permalink
Added flag for locations file
Browse files Browse the repository at this point in the history
  • Loading branch information
andreimerlescu committed Jul 9, 2023
1 parent a57fc27 commit a8f89d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions data.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ var (

// Command Line Flags
flag_s_file = config.NewString("file", "", "CSV file of URL + Metadata")
flag_s_locations_file = config.NewString("locations-file", filepath.Join(".", "private", "locations.csv"), "Path to the locations.csv file to load.")
flag_s_directory = config.NewString("dir", "", "Path of the directory you want the export to be generated into.")
flag_i_sem_limiter = config.NewInt("limit", channel_buffer_size, "Number of rows to concurrently process.")
flag_i_buffer = config.NewInt("buffer", reader_buffer_bytes, "Memory allocation for CSV buffer (min 168 * 1024 = 168KB)")
Expand Down
4 changes: 2 additions & 2 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,14 @@ func main() {
go func() {
wg_active_tasks.Add(1)
defer wg_active_tasks.Done()
locationsCsvErr := loadCsv(ctx, filepath.Join(".", "private", "locations.csv"), processLocation)

locationsCsvErr := loadCsv(ctx, *flag_s_locations_file, processLocation)
if locationsCsvErr != nil {
log.Printf("received an error from loadCsv/loadXlsx namely: %v", locationsCsvErr) // a problem habbened
return
}

a_b_locations_loaded.Store(true)

}()

var importErr error
Expand Down

0 comments on commit a8f89d6

Please sign in to comment.