fix: make country dashboard backfill atomic
This commit is contained in:
parent
c99542ebe9
commit
35458a674e
@ -146,15 +146,21 @@ public class DatavRestController extends BaseController {
|
|||||||
}
|
}
|
||||||
LocalDate parsedStartDate = LocalDate.parse(startDate);
|
LocalDate parsedStartDate = LocalDate.parse(startDate);
|
||||||
LocalDate parsedEndDate = LocalDate.parse(endDate);
|
LocalDate parsedEndDate = LocalDate.parse(endDate);
|
||||||
List<String> refreshedTimezones = countryDashboardBackfillLockService.call(
|
Map<String, Object> refreshed = countryDashboardBackfillLockService.call(() -> {
|
||||||
() -> countryDashboardGameMetricService.refreshRange(
|
List<String> countryTimezones = countryDashboardDailyMetricService.refreshRange(
|
||||||
parsedStartDate, parsedEndDate, sysOrigin, statTimezones));
|
parsedStartDate, parsedEndDate, sysOrigin, statTimezones);
|
||||||
|
List<String> gameTimezones = countryDashboardGameMetricService.refreshRange(
|
||||||
|
parsedStartDate, parsedEndDate, sysOrigin, statTimezones);
|
||||||
|
return Map.of(
|
||||||
|
"countryStatTimezones", countryTimezones,
|
||||||
|
"gameStatTimezones", gameTimezones);
|
||||||
|
});
|
||||||
return Map.of(
|
return Map.of(
|
||||||
"status", "success",
|
"status", "success",
|
||||||
"startDate", parsedStartDate.toString(),
|
"startDate", parsedStartDate.toString(),
|
||||||
"endDate", parsedEndDate.toString(),
|
"endDate", parsedEndDate.toString(),
|
||||||
"sysOrigin", sysOrigin,
|
"sysOrigin", sysOrigin,
|
||||||
"statTimezones", refreshedTimezones);
|
"statTimezones", refreshed);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CountryDashboardCO emptyCountryDashboard(CountryDashboardQryCmd cmd) {
|
private CountryDashboardCO emptyCountryDashboard(CountryDashboardQryCmd cmd) {
|
||||||
|
|||||||
@ -292,7 +292,7 @@ public class CountryDashboardServiceImpl implements CountryDashboardService {
|
|||||||
limit = Math.min(100, limit);
|
limit = Math.min(100, limit);
|
||||||
|
|
||||||
QueryCondition condition = QueryCondition.of(cmd);
|
QueryCondition condition = QueryCondition.of(cmd);
|
||||||
String countryCodes = trimToNull(cmd == null ? null : cmd.getCountryCodes());
|
String countryCodes = QueryCondition.trimToNull(cmd == null ? null : cmd.getCountryCodes());
|
||||||
long total = safeLong(countryDashboardDAO.countRechargeDetails(
|
long total = safeLong(countryDashboardDAO.countRechargeDetails(
|
||||||
condition.startTime, condition.endTime, condition.countryKeyword, countryCodes,
|
condition.startTime, condition.endTime, condition.countryKeyword, countryCodes,
|
||||||
condition.sysOrigin, condition.storageTimezoneOffset, condition.statTimezoneOffset));
|
condition.sysOrigin, condition.storageTimezoneOffset, condition.statTimezoneOffset));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user