mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-09-13 06:11:59 +00:00
fix data obtain from the memory cache
This commit is contained in:
parent
5422104b46
commit
e9474b1214
@ -28,11 +28,13 @@ if (isset($_SESSION['userName'])) {
|
|||||||
'avatar' => $mcAvatar
|
'avatar' => $mcAvatar
|
||||||
];
|
];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2: try to obtain avatar from DHT
|
* Step 2: try to obtain avatar from DHT
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
} else if ($dhtAvatarRevisions = $_twister->getDHTAvatarRevisions($userName)) {
|
if ($dhtAvatarRevisions = $_twister->getDHTAvatarRevisions($userName)) {
|
||||||
|
|
||||||
// Add DHT version if not exists
|
// Add DHT version if not exists
|
||||||
foreach ((array) $dhtAvatarRevisions as $dhtAvatarRevision) {
|
foreach ((array) $dhtAvatarRevisions as $dhtAvatarRevision) {
|
||||||
@ -96,6 +98,7 @@ if (isset($_SESSION['userName'])) {
|
|||||||
// Save identity icon into the cache pool
|
// Save identity icon into the cache pool
|
||||||
$_memcache->set('api.user.avatar.' . $userName, $identityIcon, MEMCACHE_COMPRESS, MEMCACHE_DHT_AVATAR_TIMEOUT);
|
$_memcache->set('api.user.avatar.' . $userName, $identityIcon, MEMCACHE_COMPRESS, MEMCACHE_DHT_AVATAR_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// User not found in the local database registry
|
// User not found in the local database registry
|
||||||
} else {
|
} else {
|
||||||
|
@ -28,11 +28,13 @@ if (isset($_SESSION['userName'])) {
|
|||||||
'profile' => $mcProfile
|
'profile' => $mcProfile
|
||||||
];
|
];
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 2: try to obtain profile from DHT
|
* Step 2: try to obtain profile from DHT
|
||||||
*
|
*
|
||||||
* */
|
* */
|
||||||
} else if ($dhtProfileRevisions = $_twister->getDHTProfileRevisions($userName)) {
|
if ($dhtProfileRevisions = $_twister->getDHTProfileRevisions($userName)) {
|
||||||
|
|
||||||
// Add DHT version if not exists
|
// Add DHT version if not exists
|
||||||
foreach ((array) $dhtProfileRevisions as $dhtProfileRevision) {
|
foreach ((array) $dhtProfileRevisions as $dhtProfileRevision) {
|
||||||
@ -93,6 +95,7 @@ if (isset($_SESSION['userName'])) {
|
|||||||
'profile' => []
|
'profile' => []
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// User not found in the local database registry
|
// User not found in the local database registry
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user