Skip to content

Commit

Permalink
implementing getting fixed number of lates events feature: WIP.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryogrid committed May 5, 2024
1 parent 526cbb7 commit 4b56d43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/nuts_db_data_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const ProfEvtIdxMap = "ProfEvtIdxMap"
const FollowListEvtIdxMap = "FollowListEvtIdxMap"
const ReSendNeededEvtList = "ReSendNeededEvtList"

// index 0 is the key for getting latest EventNumReturnAtFirstKind40000 num entries
// when number of stored events is larger than EventNumReturnAtFirstKind40000
const EventListKeyListForLimit = "EvtListKeyListForLimit"

func NewNutsDBDataManager() DataManager {
dbFilePath := "./" + strconv.FormatUint(glo_val.SelfPubkey64bit, 16)
if _, err := os.Stat(dbFilePath); os.IsNotExist(err) {
Expand Down
1 change: 1 addition & 0 deletions np2p_const/np2p_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ const ResendCcheckInterval = time.Minute * 1
const ResendTimeBaseMin = 5
const ResendMaxTimes = 10 // Max time is 5*2^10 = 5120 minutes = about 3.5 days
const MemoryUsageLimitForDBBuffer = 50 * 1024 * 1024 // 50MB
const EventNumReturnAtFirstKind40000 = 300

0 comments on commit 4b56d43

Please sign in to comment.