ORFAP / FAPBackend

0 stars 0 forks source link

wrong return on call of isRouteInMonthOfYear() #45

Closed o4ier closed 8 years ago

o4ier commented 8 years ago

As of now, there are only flights and routes of 2015-12 in the database. If 2015-11 is to be crawled, isRouteInMonthOfYear(usedYear + "-" + i), where usedYear=2015, i = 11, returns "true". This should not be. 2015-10 can be crawled normally. 2015-9 has the same issue. Does not occur when crawling chronlogically, e.g. 2014-1, then 2014-2...

@Arne2 thought is that every second month has this problem - please check if calender makes problems again, if going backward chronologically.

darenegade commented 8 years ago

Call on http://10.28.2.166/api/routes/search/isRouteInMonthOfYear?date=2015-9 returns false

darenegade commented 8 years ago

Crawling the data not chronologically makes absolutely no sense

darenegade commented 8 years ago

Seems to be a Timezone problem in the docker Container. If i save the following route:

{
    "date": "2015-12-01",
    "source": "http://10.28.2.166/api/markets/yyy",
    "destination": "http://10.28.2.166/api/markets/yyy",
    "airline": "http://10.28.2.166/api/airlines/yyy"
}

I get a true on the request: http://10.28.2.166/api/routes/search/isRouteInMonthOfYear?date=2015-11 But the Date Field Header of the Response is 2 Hours behind.

So if I save a 2015-12-01T00:00:00 it will be converted to the timezone of the container which ends in 2015-11-30T22:00:00.

Test: A Request on http://10.28.2.166/api/routes/search/findByDateBetween?start=11%2F01%2F2015&end=11%2F30%2F2015 to get all Routes of November returns an empty list.

Long story short: Fixing the timezone in the docker containers fix this problem.

darenegade commented 8 years ago

I just started the backend with the right timezone

docker run -d -e TZ=GMT+2 -e "SPRING_PROFILES_ACTIVE=production" -p 8081:8080 darenegade/fapbackend

and with the same commands as posted above (https://github.com/ORFAP/FAPBackend/issues/45#issuecomment-229128687) i got a false on 2015-11