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

(#42) docs: add schedule by crontab #43

Closed
wants to merge 2 commits into from

Conversation

seunggabi
Copy link
Contributor

#42

@seunggabi seunggabi changed the title Docs/#42 schedule (#42) docs: add schedule by crontab May 31, 2023
Copy link
Owner

@roeniss roeniss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution!

```sh
crontab -e

0 0,6-23 * * * PATH=$PATH:/opt/homebrew/bin && dhapi buy_lotto645 -q
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does 0 0,6-23 * * * mean? This cronjob will fail every 125 of 126. I think the cron schedule should be like 0 0 * * 1 or 0 0 * * FRI.

If you're assuming an unusual request failure (e.g., network connection shortage), it would be better to notify it somehow.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

로또 6/45의 구입안내
매일 6시부터 24시까지 1년 365일 연중무휴 판매합니다. 추첨일(토요일)에는 오후 8시에 판매 마감합니다. 추첨일 오후 8시부터 다음날(일요일) 오전 6시까지는 판매가 정지됩니다.

https://crontab.guru/#0_0,6-23___*
스크린샷 2023-06-06 오후 4 01 57

see this~~!

Copy link
Owner

@roeniss roeniss Jun 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seunggabi In dhlottery online page, you can only buy 5 tickets per week. Have you tested your cronjob to see what happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 늦게 이해했는데,
맥북인 경우, 컴퓨터가 언제 켜질지 몰라서, 매시간마다 호출하는게 좋아보였어요.
말씀하신 것처럼 매주에 처음 한번만 정상구매가 일어나긴한데, 언제 컴퓨터를 켤지 모르니..ㅠ

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seunggabi I'm happy that you get my idea!

언제 컴퓨터를 켤지 모르니..ㅠ

You are assuming that you're gonna boot your MacBook up once a week at least and that's highly unstable. So your cron still doesn't cover every corner case (e.g., you bootup after 8 day from last boot)

컴퓨터가 언제 켜질지 몰라서

In this case, I suggest you check out this issue:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇네요 ㅋㅋ 좋은 아이디어긴 한데,
github action 을 모르는 일반 유저? 에게 crontab 가이드는 도움될듯합니다.

이거 owner 분께서 고민해보시고 닫아주세용~

@seunggabi seunggabi requested a review from roeniss June 6, 2023 07:03
@roeniss
Copy link
Owner

roeniss commented Jun 9, 2023

@seunggabi 여러 차례 생각해보았는데 이 PR 과 관련 이슈는 클로즈 하겠습니다.

이 프로그램은 동행복권의 인가를 받은 프로그램이 아닙니다. 따라서 (실제론 큰 의미가 없더라도) 가급적 동행복권 서버에 영향을 덜 주는 방향으로 유도해야 된다고 생각합니다.

이 pr 이 통과되면, 동행복권 서버의 부하를 늘리는 꼴을 만드는 셈이므로, 굳이 장려할 필요가 없다고 생각합니다. GitHub Actions 를 모르시는 분은... 매번 수동으로 하시는게 맞다고 생각합니다.

아쉽지만 클로즈하겠습니다!

@roeniss roeniss closed this Jun 9, 2023
@roeniss roeniss mentioned this pull request Jun 9, 2023
@seunggabi seunggabi deleted the docs/#42_schedule branch June 26, 2023 05:24
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.

None yet

2 participants