Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitc7a425e

Browse files
authored
Merge pull requestlowcoder-org#1079 from goldants/fix/expire
Fix 500 issue when cookie expires
2 parentsdfaf965 +c5753c0 commitc7a425e

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/framework/filter/UserSessionPersistenceFilter.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
importorg.springframework.web.server.WebFilter;
2020
importorg.springframework.web.server.WebFilterChain;
2121
importreactor.core.publisher.Mono;
22+
importreactor.core.scheduler.Schedulers;
2223

2324
importjava.time.Instant;
2425
importjava.util.Optional;
@@ -121,7 +122,8 @@ private Mono<User> refreshOauthToken(Triple<User, Connection, String> triple) {
121122
oAuth2RequestContext.setAuthConfig(findAuthConfig.authConfig());
122123

123124
returnauthRequestFactory.build(oAuth2RequestContext);
124-
}).flatMap(authRequest -> {
125+
})
126+
.publishOn(Schedulers.boundedElastic()).flatMap(authRequest -> {
125127
if(authRequest ==null) {
126128
returnMono.just(user);
127129
}

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/runner/migrations/DatabaseChangelog.java‎

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
importorg.springframework.data.mongodb.core.query.Query;
4040
importorg.springframework.data.mongodb.core.query.Update;
4141

42+
importjava.time.Instant;
4243
importjava.util.Set;
4344

4445
importstaticorg.lowcoder.domain.util.QueryDslUtils.fieldName;
@@ -246,7 +247,31 @@ public void processDocument(Document document) {
246247
});
247248
}
248249

249-
@ChangeSet(order ="024",id ="add-gid-indexes-unique",author ="")
250+
@ChangeSet(order ="024",id ="fill-create-at",author ="")
251+
publicvoidfillCreateAt(MongockTemplatemongoTemplate) {
252+
// Create a query to match all documents
253+
Queryquery =newQuery();
254+
255+
// Use a DocumentCallbackHandler to iterate through each document
256+
mongoTemplate.executeQuery(query,"folder",newDocumentCallbackHandler() {
257+
@Override
258+
publicvoidprocessDocument(Documentdocument) {
259+
Objectobject =document.get("createdAt");
260+
if (object !=null)return;
261+
// Create an update object to add the 'gid' field
262+
Updateupdate =newUpdate();
263+
update.set("createdAt",Instant.now());
264+
265+
// Create a query to match the current document by its _id
266+
QueryidQuery =newQuery(Criteria.where("_id").is(document.getObjectId("_id")));
267+
268+
// Update the document with the new 'gid' field
269+
mongoTemplate.updateFirst(idQuery,update,"folder");
270+
}
271+
});
272+
}
273+
274+
@ChangeSet(order ="025",id ="add-gid-indexes-unique",author ="")
250275
publicvoidaddGidIndexesUnique(MongockTemplatemongoTemplate) {
251276
// collections to add gid
252277
String[]collectionNames = {"group","organization"};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp