aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-01-31 13:29:56 +0000
committerMario <mario@mariovavti.com>2024-01-31 13:29:56 +0000
commitb3a5dd8aa8c8990e6139fc817f9c9f706d2e0976 (patch)
tree1bc009f141312d2a331bead37360fe8a6b33241b
parent26ee56f39cbafcc6f7043026708cafdd1523bcec (diff)
downloadvolse-hubzilla-b3a5dd8aa8c8990e6139fc817f9c9f706d2e0976.tar.gz
volse-hubzilla-b3a5dd8aa8c8990e6139fc817f9c9f706d2e0976.tar.bz2
volse-hubzilla-b3a5dd8aa8c8990e6139fc817f9c9f706d2e0976.zip
store seen mids in session instead of cache and increase sess_data column to medium text
-rw-r--r--Zotlabs/Module/Sse_bs.php15
-rw-r--r--Zotlabs/Update/_1262.php30
-rw-r--r--boot.php2
3 files changed, 43 insertions, 4 deletions
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index 279b20982..f335a9ada 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -120,8 +120,17 @@ class Sse_bs extends Controller {
$mids = [];
$str = '';
+ $slice = 0;
- $mids_all = unserialise(Cache::get('sse_mids_all_' . session_id())) ?? [];
+ $mids_all = unserialise($_SESSION['sse_mids_all']) ?? [];
+
+ if (count($mids_all) > 3000) {
+ $slice = count($mids_all) - 3000;
+ }
+
+ if ($slice) {
+ $mids_all = array_slice($mids_all, $slice);
+ }
foreach($arr as $a) {
$mid_str = '\'' . dbesc(unpack_link_id($a)) . '\'';
@@ -132,7 +141,7 @@ class Sse_bs extends Controller {
}
}
- Cache::set('sse_mids_all_' . session_id(), serialise($mids_all));
+ $_SESSION['sse_mids_all'] = serialise($mids_all);
if(! self::$uid) {
return;
@@ -443,7 +452,7 @@ class Sse_bs extends Controller {
$sql_extra2 = " AND CASE WHEN verb = '" . ACTIVITY_SHARE . "' THEN owner_xchan ELSE author_xchan END IN (" . self::$xchans . ") ";
$sql_extra3 = '';
- $sse_mids_all = unserialise(Cache::get('sse_mids_all_' . session_id())) ?? [];
+ $sse_mids_all = unserialise($_SESSION['sse_mids_all']) ?? [];
if ($sse_mids_all) {
$sql_extra3 = " AND mid NOT IN (" . protect_sprintf(implode(',', $sse_mids_all)) . ") ";
}
diff --git a/Zotlabs/Update/_1262.php b/Zotlabs/Update/_1262.php
new file mode 100644
index 000000000..f457a0116
--- /dev/null
+++ b/Zotlabs/Update/_1262.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1262 {
+
+ function run() {
+
+ dbq("START TRANSACTION");
+
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r = true;
+ }
+
+ if(ACTIVE_DBTYPE == DBTYPE_MYSQL) {
+ $r = dbq("ALTER TABLE session MODIFY COLUMN sess_data MEDIUMTEXT NOT NULL");
+ }
+
+ if($r) {
+ dbq("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+
+ }
+
+}
diff --git a/boot.php b/boot.php
index bc5abfd50..92583aec0 100644
--- a/boot.php
+++ b/boot.php
@@ -65,7 +65,7 @@ define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '8.9.5');
define('ZOT_REVISION', '6.0');
-define('DB_UPDATE_VERSION', 1261);
+define('DB_UPDATE_VERSION', 1262);
define('PROJECT_BASE', __DIR__);