티스토리 뷰
반응형
비즈니스 로직을 구현하다보면, 매월 사용자 정보를 업데이트 하는 쿼리를 작동시켜야 한다던가
1년 동안 로그인하지않은 사용자를 휴면계정 처리해야하는 등의 이벤트를 처리해야할 일이 있다.
그럴때 node-schedule 라이브러리를 통해 쉽게 구현이 가능하다.
const schedule = require("node-schedule");
app.listen(port, () => {
//매일 23:59:00 마다 이벤트 처리
const dailyCheckUserLaskWork = schedule.scheduleJob("00 59 23 * * *", function () {
//원하는 이벤트 처리
});
});
schedule Job의 시간 설정 방식은 다음과 같다.
* 을 적을 시 all을 의미함
반응형
'Server' 카테고리의 다른 글
[node.js] base 64 이미지 decode 및 저장 방법 (0) | 2022.05.04 |
---|---|
[Express] http로 접속시 https로 redirect (0) | 2022.05.03 |
[Express] session mySQL에 저장하기 (0) | 2022.05.03 |
[Express] bcrypt 을 사용한 비대칭 암호화, password 비대칭 암호화 (0) | 2021.11.12 |
[Express] request is not defined 해결법 (0) | 2021.09.13 |
댓글
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- ERROR: failed to solve: no support for running processes with linux/amd64/v3 platform
- Pytorch #Yolov5 #Segementation
- see ec2 instance connect prerequisites at https://docs.aws.amazon.com/awsec2/latest/userguide #인스턴스 연결 안됨
- docker mysql
- JavaScript #Programmers #lvl2 #프로그래머스 오픈채팅방 # 오픈채팅방 문제
- reack-cookies #아이디 저장하기 #react 아이디 저장 #react cookie #리엑트 아이디 저장하기
- linux/amd64/v2
- React filter #js Includes #React Filter includes
- 이미지 전송 # 이미지 업로드 #이미지 여러장 #이미지 여러장 업로드 #react 이미지 업로드 #react 이미지 여러장 업로드
- docker # docker build # m1 docker build
- BOJ #JS
- node.js 파일 저장
- Mac docker.for.mac.host.internal
- supported: linux/amd64
- excel 파일 만들기 #node.js #express excel 파일 만들기 #데이터 입력해서 excel 파일 만들기
- AWS #인바운드 #SSH #인스턴스 연결
- mysql date type
- mysql date between performance
- Express multer #Express File 저장 #node.js
- PDF #pdfkit
- react #img 전송
- react #react-spinners #modal loading #overlay #로딩창 #react 로딩창 만들기
- ec2 instance connect is unable to connect to your instance. ensure your instance network settings are configured correctly for ec2 instance connect. for more information
- PoolCluster : Error: connect ECONNREFUSED 127.0.0.1:3306)
- mysql date between # mysql date between 대소 비교 연산자
- mysql date
- Swal #sweetalert2 #alert #알림창 띄우기 #react swal
- Procedure #mysql #mysql Procedure #mysql 반복문 #Procedure 반복문 #mysql insert 반복문
- node.js #node.js pdf만들기 #node.js pdfkit
- FormData #FormData 파일전송 #FormData append json # React FormData File #React FormData append Json
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함