Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

mangotree2
Copy link

@mangotree2 mangotree2 commented Apr 29, 2020

fix this:
`

// given
	cache, _ := bigcache.NewBigCache(bigcache.Config{
		Shards:             1,
		LifeWindow:         5 * time.Second,
		MaxEntriesInWindow: 2,
		MaxEntrySize:       400,
		HardMaxCacheSize:   1,
		Verbose:true,
	})

	// when
	_ = cache.Set("key1", blob('a', 1024*400))
	_ = cache.Set("key2", blob('b', 1024*400))
	_ = cache.Set("key3", blob('c', 1024*400))
	key4Err := cache.Set("key4", blob('d', 1024*400))
	if key4Err != nil {
		panic(key4Err)
	}

`

@mangotree2 mangotree2 force-pushed the master branch 2 times, most recently from b109437 to e544d8d Compare April 29, 2020 06:08
Change-Id: Id068d2a9baf44a9e4e8941464c0316aa0965ac4f
@siennathesane
Copy link
Collaborator

@mangotree2 would you be able to provide more context on what you're trying to fix? I don't understand the context of the problem nor the context of the proposed fix.

@mangotree2
Copy link
Author

@mxplusb @neal-zhu
When maxCapacity is set and the queue is full, head will be equal to tail, and full will be set to true. When Push, canInsertAfterTail and canInsertBeforeHead will judge that the queue is full, it will remove the entry, but will not reset the full field, resulting in After the entry is removed, there is no room.
Can run my test case,but I can’t modify it correctly - -

@siennathesane
Copy link
Collaborator

I'm going to convert this to a draft so you can continue working on it until the tests pass. :)

@siennathesane siennathesane marked this pull request as draft May 6, 2020 21:20
@cristaloleg
Copy link
Collaborator

@mangotree2 kindly ping 😉

@mangotree2
Copy link
Author

@mangotree2 kindly ping 😉


555 T.T .

@cristaloleg
Copy link
Collaborator

Sorry, what?

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.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.