data & perftest
This commit is contained in:
24
crawler/perftest.ts
Normal file
24
crawler/perftest.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import {createLogger,transports, format} from 'winston';
|
||||
import { createClient } from 'redis';
|
||||
const logger = createLogger({
|
||||
transports: [
|
||||
new transports.Console(),
|
||||
],
|
||||
format: format.combine(
|
||||
format.colorize(),
|
||||
format.timestamp(),
|
||||
format.printf(({ timestamp, level, message, service }) => {
|
||||
return `[${timestamp}] ${service} ${level}: ${message}`;
|
||||
})
|
||||
),
|
||||
});
|
||||
const redis = await createClient()
|
||||
.on('error', err => console.log('Redis Client Error', err))
|
||||
.connect();
|
||||
|
||||
(async () => {
|
||||
logger.info(`start findBusinessListings:`);
|
||||
const result = await redis.ft.search('business:index','*',{LIMIT:{from:0,size:50}});
|
||||
logger.info(`end findBusinessListings:`);
|
||||
redis.disconnect();
|
||||
})();
|
||||
Reference in New Issue
Block a user