mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
2.0.1
Фикс уведомлений при обновлении расписания и хеширования кеша.
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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",
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user