{"action":"created","issue":{"url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/476","repository_url":"https://api.github.com/repos/pinterest/PINRemoteImage","labels_url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/476/labels{/name}","comments_url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/476/comments","events_url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/476/events","html_url":"https://github.com/pinterest/PINRemoteImage/issues/476","id":362247169,"node_id":"MDU6SXNzdWUzNjIyNDcxNjk=","number":476,"title":"Setting diskCache.byteLimit does not work","user":{"login":"romansorochak","id":7702356,"node_id":"MDQ6VXNlcjc3MDIzNTY=","avatar_url":"https://avatars2.githubusercontent.com/u/7702356?v=4","gravatar_id":"","url":"https://api.github.com/users/romansorochak","html_url":"https://github.com/romansorochak","followers_url":"https://api.github.com/users/romansorochak/followers","following_url":"https://api.github.com/users/romansorochak/following{/other_user}","gists_url":"https://api.github.com/users/romansorochak/gists{/gist_id}","starred_url":"https://api.github.com/users/romansorochak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romansorochak/subscriptions","organizations_url":"https://api.github.com/users/romansorochak/orgs","repos_url":"https://api.github.com/users/romansorochak/repos","events_url":"https://api.github.com/users/romansorochak/events{/privacy}","received_events_url":"https://api.github.com/users/romansorochak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-20T15:39:41Z","updated_at":"2018-09-26T21:03:06Z","closed_at":null,"author_association":"NONE","body":"Hi \r\n\r\nI tried to set maximum bytes that PINCache can use from disk.\r\nPINRemoteImageManager.shared().pinCache?.diskCache.byteLimit = 50 * 1024 * 1024 // ~50 MB\r\n\r\nBut when I tried to reach this number I saw that the maximum space it took was just 20 MB. \r\nThen it started trimming previously cached images.\r\n\r\nsome test code to see the issue:\r\n            \r\n            PINRemoteImageManager.shared().pinCache?.diskCache.byteLimit = 50 * 1024 * 1024\r\n            \r\n            if let bytes = PINRemoteImageManager.shared().pinCache?.diskCache.byteLimit {\r\n                let KBs = Double(bytes) / 1024\r\n                let MBs = KBs / 1024\r\n                print(\"PINRemoteImageManager diskCache.byteLimit: \\(MBs))\")\r\n            }\r\n\r\n            if let bytes = PINRemoteImageManager.shared().pinCache?.diskByteCount {\r\n                let KBs = Double(bytes) / 1024\r\n                let MBs = KBs / 1024\r\n                print(\"PINRemoteImageManager MB used: \\(MBs)\")\r\n            }\r\n\r\nI am using PINRemoteImage as part of Texture framework.\r\n\r\nCan anyone help please ?\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/comments/424868795","html_url":"https://github.com/pinterest/PINRemoteImage/issues/476#issuecomment-424868795","issue_url":"https://api.github.com/repos/pinterest/PINRemoteImage/issues/476","id":424868795,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDg2ODc5NQ==","user":{"login":"nguyenhuy","id":587874,"node_id":"MDQ6VXNlcjU4Nzg3NA==","avatar_url":"https://avatars1.githubusercontent.com/u/587874?v=4","gravatar_id":"","url":"https://api.github.com/users/nguyenhuy","html_url":"https://github.com/nguyenhuy","followers_url":"https://api.github.com/users/nguyenhuy/followers","following_url":"https://api.github.com/users/nguyenhuy/following{/other_user}","gists_url":"https://api.github.com/users/nguyenhuy/gists{/gist_id}","starred_url":"https://api.github.com/users/nguyenhuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguyenhuy/subscriptions","organizations_url":"https://api.github.com/users/nguyenhuy/orgs","repos_url":"https://api.github.com/users/nguyenhuy/repos","events_url":"https://api.github.com/users/nguyenhuy/events{/privacy}","received_events_url":"https://api.github.com/users/nguyenhuy/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T21:03:06Z","updated_at":"2018-09-26T21:03:06Z","author_association":"MEMBER","body":"This might be because `ASPINRemoteImageDownloader` has its own `PINRemoteImageManager` with a byte limit of 20MB ([here](https://github.com/TextureGroup/Texture/blob/master/Source/Details/ASPINRemoteImageDownloader.m#L90))."}}
{"actor":{"display_login":"nguyenhuy"}}