the browser-facing portion of osu!
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update reset calls

nanaya 0fecbea5 fd59c7be

+10 -10
+1 -1
app/Libraries/Groups.php
··· 90 90 // TODO: This shouldn't have to be called here, since it's already 91 91 // called by `Group::afterCommit`, but `Group::afterCommit` isn't 92 92 // running in tests when creating/saving `Group`s. 93 - $this->resetCache(); 93 + $this->resetMemoized(); 94 94 } 95 95 96 96 return $group;
+1 -1
app/Models/Group.php
··· 119 119 120 120 public function afterCommit() 121 121 { 122 - app('groups')->resetCache(); 122 + app('groups')->resetMemoized(); 123 123 } 124 124 125 125 private function getColour(): ?string
+5 -5
app/Traits/Memoizes.php
··· 9 9 { 10 10 private $memoized = []; 11 11 12 + public function resetMemoized(): void 13 + { 14 + $this->memoized = []; 15 + } 16 + 12 17 protected function memoize(string $key, callable $function) 13 18 { 14 19 if (!array_key_exists($key, $this->memoized)) { ··· 16 21 } 17 22 18 23 return $this->memoized[$key]; 19 - } 20 - 21 - protected function resetMemoized(): void 22 - { 23 - $this->memoized = []; 24 24 } 25 25 }
+1 -1
database/factories/UserFactory.php
··· 104 104 // TODO: This shouldn't have to be called here, since it's already 105 105 // called by `Group::afterCommit`, but `Group::afterCommit` isn't 106 106 // running in tests when creating/saving `Group`s. 107 - app('groups')->resetCache(); 107 + app('groups')->resetMemoized(); 108 108 } 109 109 110 110 $user->findUserGroup($group, true)->update(['playmodes' => $playmodes]);
+2 -2
tests/Browser/SanityTest.php
··· 111 111 UserProfileCustomization::truncate(); 112 112 UserStatistics\Osu::truncate(); 113 113 114 - app('groups')->resetCache(); 114 + app('groups')->resetMemoized(); 115 115 } 116 116 117 117 private static function createScaffolding() ··· 251 251 252 252 self::$scaffolding['room'] = factory(Room::class)->create(['category' => 'spotlight']); 253 253 254 - app('groups')->resetCache(); 254 + app('groups')->resetMemoized(); 255 255 } 256 256 257 257 private static function filterLog(array $log)