refactor: improve date handling and timezone consistency
- Add timezone support to database module (+08:00) - Extract date formatting utilities to shared modules - Standardize timezone handling across frontend and backend - Improve date formatting consistency in UI components - Refactor crawler page.goto options for better readability
This commit is contained in:
@@ -139,7 +139,10 @@ export const CdtCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -142,7 +142,10 @@ export const CeicCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const CgnpcCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -134,7 +134,10 @@ export const ChdtpCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const CnncecpCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const CnoocCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const EpsCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const PowerbeijingCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -148,7 +148,10 @@ export const SdiccCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
@@ -142,7 +142,10 @@ export const SzecpCrawler = {
|
||||
logger.log(`Navigating to ${this.url}...`);
|
||||
await delayRetry(
|
||||
async () => {
|
||||
await page.goto(this.url, { waitUntil: 'networkidle2', timeout: 60000 });
|
||||
await page.goto(this.url, {
|
||||
waitUntil: 'networkidle2',
|
||||
timeout: 60000,
|
||||
});
|
||||
},
|
||||
3,
|
||||
5000,
|
||||
|
||||
Reference in New Issue
Block a user