Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refector: 調整資料儲存格式跟collection path #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

JHIH-LEI
Copy link
Collaborator

@JHIH-LEI JHIH-LEI commented Jul 16, 2023

查詢leaderboard input從date改為year跟month分開傳遞

資料存放的結構改為
collection為leaderboard-年份
每個文檔格式:
discordId
month
year
point

在merge進去之前請先通知我,我會將10月的資料整進新collection,就可以部署了

@tim80411
Copy link
Collaborator

tim80411 commented Oct 10, 2023

最後分兩個部分確認一下

  1. 沒看到你如何從月分的collection倒資料到年的資料庫的程式碼

接著比較是code quality的部分,你可以上完之後再來處理重構\文件。

  1. 寫排程類的東西最好留下comment或是文件

@JHIH-LEI
Copy link
Collaborator Author

1.從月分的collection倒資料到年的資料庫的程式碼我是寫script處理,因為是一次性暫時任務,這部分沒有commit上去
2.ok 文件這部分再來補齊,想問學長在公司時有無維護排成類的文件經驗,是否有一些該注意的事項?

@tim80411
Copy link
Collaborator

tim80411 commented Oct 11, 2023

ok 文件這部分再來補齊,想問學長在公司時有無維護排成類的文件經驗,是否有一些該注意的事項?

通常會盡量把程式碼變成文件,可以想成把運行cron跟設定job這兩件事情分開
比如說

// jobs.js
// require需要的job function進來
module.exports = [
  {
    schedule:  '0 18 1 * *', // 每個月1號晚上6點推波
    job:  notifyBillboardJobFunc,
  }
]
// cron.js
// 這裡就引入jobs.js然後start他們

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants