[TIL] 0404 - 0407
Today I Learnt
0404
장염에 걸려서 죽을뻔했다.
한국에서도 안 걸리는 장염을 호주까지 와서 정신 못 차리고 있네...
요즘 면역력이 딸리는 건지, 여기저기가 아픈데... 왜 이런 거지
web accessbility: 요즘 대기업들 중에 뜬다는 web accessibility. 장애인과 비장애인 모두 웹사이트를 잘 사용할 수 있도록 도와준다.
가령 눈이 잘 안 보이는 사람에게는 설명으로 가르쳐준다거나, 소리가 안 들리는 사람한테는 소리 대신 다른 방법으로 피드백을 주는 방법 등으로 프런트단에서 처리를하는것같다. 당연히 스타트업에나 작은 회사의 웹사이트들에서는 서포트를안해주지만 요즘 미국이나 큰회사들에서는 프론트단에서 이것만 처리하는 팀이 있을 정도로 specialist인 것 같다.
개발자 중에서도 자기만에 specilty 가지고 있는 게 살아남을 수 있는 길인 것 같다.
https://monsido.com/web-accessibility
0407
스케쥴러를 찾아보다가 6개의 sceduler를 비교해본 웹사이트가 잇다.
https://blog.logrocket.com/comparing-best-node-js-schedulers/
그중에 node-cron이라는 라이브러리가 제일 좋은 것 같다.
conlcusion에도 보면 node-cron을 추천하고 , Apart from the schedule method for scheduling a job, Node-cron also exposes methods for validating a cron expression, starting, stopping, or destroying a scheduled job.라고 써 잇는 걸 보면 내가 구현하려고 하는 것들이 이걸로 다 포함이 되니깐 일단 이걸로 가자.
* seconds는 optional임
아직 테스트 안됐지만- 오늘 한번 테스트해보고 틀린 거 있으면... 다시 와서 고쳐볼게...
let taskEveryMin = cron.schedule('*/2 * * * *', () => {
console.log('Running this every two minute current time @', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
let taskEvery930 = cron.schedule('30 9 * * *', () => {
console.log('Running this by every 9:30 AM Korea Seoul Time and current log time @', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
let taskEveryHour = cron.schedule('0 */1 * * *', () => {
console.log('Running this by every hour current time @ ', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
let taskEvery2Hours = cron.schedule('0 */2 * * *', () => {
console.log('Running this by every 2hrs current time @ ', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
let taskEvery4Hours = cron.schedule('0 */4 * * *', () => {
console.log('Running this by every 4hrs current time @ ', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
let taskEvery12Hours = cron.schedule('0 */12 * * *', () => {
console.log('Running this by every 4hrs current time @ ', new Date().toLocaleTimeString('en-US'));
}, {
scheduled: true,
timezone: 'Asia/Seoul',
});
* eslint에서 let을 못쓰게 한다.
이거 진짜 자꾸 짜증 나게 하는데 안 쓸 수도 없고;
prefer-const부분에서 변경해줬다.
{
"env": {
"browser": true,
//"commonjs": true,
"es2021": true,
"node": true // require is not defined
},
"extends": ["eslint:recommended","airbnb-base"],
"parserOptions": {
"ecmaVersion": 11,
"sourceType": "module"
},
"rules": {
"indent": ["error", 4]
},
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": false
}]
}
'IT > TIL(Today I Learnt)' 카테고리의 다른 글
[TIL] 0413 Harry Potter - 0414 (3) | 2022.04.18 |
---|---|
[TIL] 0407 - 0412 (2) | 2022.04.12 |
[TIL] 0329 (2) | 2022.04.01 |
[TIL] 0328 (2) | 2022.03.29 |
[TIL] 0325 프로삽질러 (5) | 2022.03.26 |