move radius miles to broker level
This commit is contained in:
@@ -179,7 +179,7 @@ func (fe FastExact) newRequestWithState(state config.State) (*http.Request, erro
|
||||
func (fe FastExact) newRequest(zip string) (*http.Request, error) {
|
||||
req, err := http.NewRequest(
|
||||
http.MethodGet,
|
||||
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles)+"&st_loc_zip=8",
|
||||
"https://www.fastexact.com/secure/index.php?page=ajaxListJobs&action=ajax&zipcode="+zip+"&records_per_page=50&distance="+strconv.Itoa(config.Get().Brokers.RadiusMiles)+"&st_loc_zip=8",
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -292,7 +292,7 @@ func (mock mockFastExactDoer) doRequest(req *http.Request) (*http.Response, erro
|
||||
if req.URL.Query().Get("records_per_page") != "50" {
|
||||
return nil, errors.New("bad query: records_per_page should be 50")
|
||||
}
|
||||
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.FastExact.RadiusMiles) {
|
||||
if req.URL.Query().Get("distance") != strconv.Itoa(config.Get().Brokers.RadiusMiles) {
|
||||
return nil, errors.New("bad query: distance should be as configured")
|
||||
}
|
||||
if req.URL.Query().Get("zipcode") == "" {
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
"Once": false,
|
||||
"Brokers": {
|
||||
"UseZips": true,
|
||||
"FastExact": {
|
||||
"RadiusMiles": 100,
|
||||
"FastExact": {
|
||||
"Enabled": true,
|
||||
"Mock": true,
|
||||
"Username": "birdman",
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
"Once": true,
|
||||
"Brokers": {
|
||||
"UseZips": true,
|
||||
"FastExact": {
|
||||
"RadiusMiles": 100,
|
||||
"FastExact": {
|
||||
"Enabled": true,
|
||||
"Mock": true,
|
||||
"Username": "u",
|
||||
|
||||
@@ -65,6 +65,7 @@ type Config struct {
|
||||
Once bool
|
||||
Brokers struct {
|
||||
UseZips bool
|
||||
RadiusMiles int
|
||||
NTG struct {
|
||||
Enabled bool
|
||||
JobInfo bool
|
||||
@@ -76,7 +77,6 @@ type Config struct {
|
||||
}
|
||||
FastExact struct {
|
||||
Enabled bool
|
||||
RadiusMiles int
|
||||
Mock bool
|
||||
Username string
|
||||
Password string
|
||||
|
||||
Reference in New Issue
Block a user