[task] Make the db connect configurable
[task] Fix primary key conflict bug and change the unit of interval time from second to millisecond