mirror of
https://github.com/fdundjer/solana-sniper-bot.git
synced 2025-11-09 20:12:06 +10:00
fix: snipe list
This commit is contained in:
7
cache/snipe-list.cache.ts
vendored
7
cache/snipe-list.cache.ts
vendored
@ -4,9 +4,10 @@ import { logger, SNIPE_LIST_REFRESH_INTERVAL } from '../helpers';
|
|||||||
|
|
||||||
export class SnipeListCache {
|
export class SnipeListCache {
|
||||||
private snipeList: string[] = [];
|
private snipeList: string[] = [];
|
||||||
|
private fileLocation = path.join(__dirname, '../snipe-list.txt');
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
setInterval(this.loadSnipeList, SNIPE_LIST_REFRESH_INTERVAL);
|
setInterval(() => this.loadSnipeList(), SNIPE_LIST_REFRESH_INTERVAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public init() {
|
public init() {
|
||||||
@ -18,10 +19,10 @@ export class SnipeListCache {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private loadSnipeList() {
|
private loadSnipeList() {
|
||||||
logger.trace('Refreshing snipe list...');
|
logger.trace(`Refreshing snipe list...`);
|
||||||
|
|
||||||
const count = this.snipeList.length;
|
const count = this.snipeList.length;
|
||||||
const data = fs.readFileSync(path.join(__dirname, 'snipe-list.txt'), 'utf-8');
|
const data = fs.readFileSync(this.fileLocation, 'utf-8');
|
||||||
this.snipeList = data
|
this.snipeList = data
|
||||||
.split('\n')
|
.split('\n')
|
||||||
.map((a) => a.trim())
|
.map((a) => a.trim())
|
||||||
|
|||||||
Reference in New Issue
Block a user