Skip to content

Commit

Permalink
don't limit lastlowprice by wipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Aug 20, 2024
1 parent 61c8349 commit af07629
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
8 changes: 0 additions & 8 deletions src/tarkov-data-manager/jobs/archive-prices.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ class ArchivePricesJob extends DataJob {
const today = new Date();
let cutoff = new Date(new Date().setDate(today.getDate() - 30));
cutoff.setUTCHours(0, 0, 0, 0);
// if we wanted to keep all prices since start of wipe
/*const wipes = await this.query('SELECT * FROM wipe ORDER BY start_date desc limit 1');
if (wipes.length > 0) {
const currentWipe = wipes[0];
if (currentWipe.start_date < cutoff) {
cutoff = currentWipe.start_date;
}
}*/

// archive max_days_per_run number of days
for (let i = 0; i < max_days_per_run; i++) {
Expand Down
7 changes: 1 addition & 6 deletions src/tarkov-data-manager/modules/remote-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@ const methods = {

try {
const itemsPromise = methods.get(refreshItems);

const wipes = await query('SELECT * FROM wipe ORDER BY start_date desc limit 1');
const currentWipe = wipes[0];

const price24hTimer = timer('item-24h-price-query');
const price24hPromise = new Promise(async (resolve, reject) => {
Expand Down Expand Up @@ -166,16 +163,14 @@ const methods = {
game_mode
FROM
price_data
WHERE
timestamp > ?
GROUP BY
item_id, game_mode
) b
ON
a.item_id = b.item_id AND a.timestamp = b.max_timestamp AND a.game_mode = b.game_mode
GROUP BY
a.item_id, a.timestamp, a.game_mode;
`, [currentWipe.start_date]).then(results => {
`).then(results => {
lastLowPriceTimer.end();
return results;
});
Expand Down

0 comments on commit af07629

Please sign in to comment.