| Line 1... |
Line 1... |
| 1 |
package in.shop2020.serving.controllers;
|
1 |
package in.shop2020.serving.controllers;
|
| 2 |
|
2 |
|
| 3 |
import in.shop2020.datalogger.EventType;
|
3 |
import in.shop2020.datalogger.EventType;
|
| 4 |
import in.shop2020.model.v1.catalog.InventoryService.Client;
|
4 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
| 5 |
import in.shop2020.model.v1.catalog.InventoryServiceException;
|
5 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
| 6 |
import in.shop2020.serving.cache.EhcacheWrapper;
|
6 |
import in.shop2020.serving.cache.EhcacheWrapper;
|
| 7 |
import in.shop2020.serving.services.ContentServingService;
|
7 |
import in.shop2020.serving.services.ContentServingService;
|
| 8 |
import in.shop2020.serving.utils.SnippetType;
|
8 |
import in.shop2020.serving.utils.SnippetType;
|
| 9 |
import in.shop2020.thrift.clients.CatalogClient;
|
9 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 10 |
import in.shop2020.utils.DataLogger;
|
10 |
import in.shop2020.utils.DataLogger;
|
| Line 131... |
Line 131... |
| 131 |
latestArrivalCatalogIds = client.getLatestArrivalsCatalogIds(0, 12, null, Arrays.asList(new Long[]{ 10002L, 10003L, 10004L, 10010L, 10050L}));
|
131 |
latestArrivalCatalogIds = client.getLatestArrivalsCatalogIds(0, 12, null, Arrays.asList(new Long[]{ 10002L, 10003L, 10004L, 10010L, 10050L}));
|
| 132 |
latestArrivalCatalogIds.removeAll(bestDealCatalogIds);
|
132 |
latestArrivalCatalogIds.removeAll(bestDealCatalogIds);
|
| 133 |
latestArrivalCatalogIds.removeAll(bestSellerCatalogIds.subList(0, bestSellerCount)); //We're only considering the first 4 best sellers for removal.
|
133 |
latestArrivalCatalogIds.removeAll(bestSellerCatalogIds.subList(0, bestSellerCount)); //We're only considering the first 4 best sellers for removal.
|
| 134 |
if(latestArrivalCatalogIds.size() < latestArrivalCount)
|
134 |
if(latestArrivalCatalogIds.size() < latestArrivalCount)
|
| 135 |
latestArrivalCount = latestArrivalCatalogIds.size();
|
135 |
latestArrivalCount = latestArrivalCatalogIds.size();
|
| 136 |
} catch (InventoryServiceException e) {
|
136 |
} catch (CatalogServiceException e) {
|
| 137 |
logger.error("Error while fetching data from the catalog service", e);
|
137 |
logger.error("Error while fetching data from the catalog service", e);
|
| 138 |
} catch (TException e) {
|
138 |
} catch (TException e) {
|
| 139 |
logger.error("Error while fetching data from the catalog service", e);
|
139 |
logger.error("Error while fetching data from the catalog service", e);
|
| 140 |
} catch (Exception e) {
|
140 |
} catch (Exception e) {
|
| 141 |
logger.error("Unexpected exception", e);
|
141 |
logger.error("Unexpected exception", e);
|