Comments (3)
期望如果可以区分时间段不进行动作.像是 pm 9:00 - am. 10:00 不动作. 拟真点.
from ghsp2ofer.
@samjazz @ladykiki
直接可以想到的有兩種做法, (1) 在目前的 settings.py
中增加比較複雜的設定, 在規定的時間內才進行 random 選擇觸發時間, (2) 開始建立 bot profile, 讓 bot 依據 profile 發生行為.
any suggestions for better practice ?
from ghsp2ofer.
@ladykiki 已在 settings.py
中加上相關設定.
# WaitStrategy selection. The value must be one of the concrete wait strategies in wait_strategy.py
WAIT_STRATEGY = 'RandomWorkHourStrategy'
# Random commit interval
RANDOM_MIN_MINUTES = 60
RANDOM_MAX_MINUTES = 120
# Bot working hours
WORK_HOURS = [9, 18] # from 9:00AM~6:00PM
當 WAIT_STRATEGY 使用 RandomWorkHourStrategy
時, WORK_HOURS 設定可以發揮作用. 下一次進行動作的時間保證在此工作時間區間內.
但若 RANDOM_MIN_MINUTES 以及 RANDOM_MAX_MINUTES 設置的太小, 導致無法得到位於 WORK_HOURS 內的時間, 則 bot 會出現 exception 而停下. 舉例而言, 當現在時間是 4:00 AM, 但 RANDOM_MIN_MINUTES = 60, RANDOM_MAX_MINUTES = 120, 則無論如何都無法得到 WORK_HOURS = [9, 18] 的區間內時間, 那麼會丟出 exception 停下.
from ghsp2ofer.
Related Issues (11)
- set-url 錯誤 HOT 4
- proposal - mimic commit behavior from other github users
- BadCredentialsException HOT 3
- UnicodeDecodeError: 'cp950' codec can't decode HOT 1
- 睡眠時間顯示錯誤了 HOT 1
- cant not add files listed at gitignore HOT 2
- commit author name "xxx" if executed by administrator HOT 2
- Auto pull request ? HOT 1
- A bots admin panel / dashboard
- supporting multiple repositories HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ghsp2ofer.