Feature/do not tweet on weekend (#961)

* Do not tweet on the weekend

* Update changelog
This commit is contained in:
Thomas Kaul 2022-05-27 11:37:48 +02:00 committed by GitHub
parent 69088b93a6
commit e79be9f2d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Changed the twitter bot service to rest on the weekend
- Upgraded `prisma` from version `3.12.0` to `3.14.0` - Upgraded `prisma` from version `3.12.0` to `3.14.0`
### Fixed ### Fixed

View File

@ -13,7 +13,7 @@ import {
} from '@ghostfolio/common/helper'; } from '@ghostfolio/common/helper';
import { UniqueAsset } from '@ghostfolio/common/interfaces'; import { UniqueAsset } from '@ghostfolio/common/interfaces';
import { Injectable, Logger } from '@nestjs/common'; import { Injectable, Logger } from '@nestjs/common';
import { isSunday } from 'date-fns'; import { isWeekend } from 'date-fns';
import * as roundTo from 'round-to'; import * as roundTo from 'round-to';
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2'; import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
@ -40,7 +40,7 @@ export class TwitterBotService {
public async tweetFearAndGreedIndex() { public async tweetFearAndGreedIndex() {
if ( if (
!this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX') || !this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX') ||
isSunday(new Date()) isWeekend(new Date())
) { ) {
return; return;
} }