Фикс уведомлений при обновлении расписания и хеширования кеша.
This commit is contained in:
2024-10-21 00:50:12 +04:00
parent 39ba88105f
commit ab15fdc136
4 changed files with 6 additions and 8 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "schedule-parser-next", "name": "schedule-parser-next",
"version": "2.0.0", "version": "2.0.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "schedule-parser-next", "name": "schedule-parser-next",
"version": "2.0.0", "version": "2.0.1",
"license": "UNLICENSED", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@nestjs/cache-manager": "^2.2.2", "@nestjs/cache-manager": "^2.2.2",

View File

@@ -1,6 +1,6 @@
{ {
"name": "schedule-parser-next", "name": "schedule-parser-next",
"version": "2.0.0", "version": "2.0.1",
"description": "", "description": "",
"author": "N08I40K", "author": "N08I40K",
"private": true, "private": true,

View File

@@ -201,8 +201,6 @@ export class V1ScheduleService {
const dom = await this.getDOM(siteMainPageDto.mainPage); const dom = await this.getDOM(siteMainPageDto.mainPage);
const url = this.parseData(dom); const url = this.parseData(dom);
console.log(url);
return await this.updateDownloadUrl(url); return await this.updateDownloadUrl(url);
} }

View File

@@ -77,11 +77,11 @@ export class V2ScheduleService {
this.cacheUpdatedAt = new Date(); this.cacheUpdatedAt = new Date();
const oldHash = this.cacheHash; const oldHash = this.cacheHash;
this.cacheHash = objectHash.sha1(schedule.groups); this.cacheHash = objectHash.sha1(schedule.etag);
if (this.cacheHash !== oldHash) { if (this.cacheHash !== oldHash) {
if (this.scheduleUpdatedAt.valueOf() !== 0 && !silent) { if (this.scheduleUpdatedAt.valueOf() !== 0) {
await this.v1ScheduleService.refreshCache(true); if (!silent) await this.v1ScheduleService.refreshCache(true);
const isReplaced = await this.scheduleReplacerService.hasByEtag( const isReplaced = await this.scheduleReplacerService.hasByEtag(
schedule.etag, schedule.etag,