This repository was archived by the owner on Jun 16, 2024. It is now read-only.
File tree 6 files changed +8
-2
lines changed
6 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import { mutate } from "swr";
3
3
import * as Rails from "@rails/ujs" ;
4
4
import dayjs from "dayjs" ;
5
5
6
+ import { CHAT_CACHE_KEY } from "./meta" ;
7
+
6
8
import { useState , useEffect } from "react" ;
7
9
8
10
export class ApiError extends Error {
@@ -509,7 +511,7 @@ export const Api = {
509
511
useChatSession ( attendeeId : number | undefined ) {
510
512
// attendeeId for cache buster
511
513
return useSWR < GetChatSessionResponse , ApiError > (
512
- attendeeId ? `/api/chat_session?i=${ attendeeId } ` : null ,
514
+ attendeeId ? `/api/chat_session?i=${ attendeeId } &p= ${ CHAT_CACHE_KEY } ` : null ,
513
515
swrFetcher ,
514
516
{
515
517
revalidateOnFocus : true ,
Original file line number Diff line number Diff line change 1
1
export const DEFAULT_AVATAR_URL = document . querySelector < HTMLMetaElement > ( 'meta[name="rkto:default-avatar"]' ) ?. content ;
2
2
export const SENTRY_DSN = document . querySelector < HTMLMetaElement > ( 'meta[name="rkto:sentry-dsn"]' ) ?. content ;
3
+ export const CHAT_CACHE_KEY = document . querySelector < HTMLMetaElement > ( 'meta[name="rkto:chat-cache-key"]' ) ?. content ;
Original file line number Diff line number Diff line change 14
14
15
15
< meta name ="rkto:commit " content ="<%= Rails . application . config . x . release_meta . commit %> ">
16
16
< meta name ="rkto:release " content ="<%= Rails . application . config . x . release_meta . version %> ">
17
+ < meta name ="rkto:chat-cache-key " content ="<%= Rails . application . config . x . release_meta . chat_cache_key %> ">
17
18
18
19
<%= stylesheet_pack_tag 'vendor' , media : 'all' %>
19
20
<%= stylesheet_pack_tag 'application' , media : 'all' %>
Original file line number Diff line number Diff line change 14
14
config . x . sentry . dsn = ENV [ 'SENTRY_DSN' ]
15
15
config . x . release_meta . commit = ''
16
16
config . x . release_meta . version = ''
17
+ config . x . release_meta . chat_cache_key = ENV [ 'TAKEOUT_CHAT_CACHE_KEY' ]
17
18
18
19
config . x . control . password = ENV [ 'TAKEOUT_CONTROL_PASSWORD' ]
19
20
Original file line number Diff line number Diff line change 21
21
config . x . sentry . dsn = ENV [ 'SENTRY_DSN' ]
22
22
config . x . release_meta . commit = ENV [ 'HEROKU_SLUG_COMMIT' ]
23
23
config . x . release_meta . version = ENV [ 'HEROKU_RELEASE_VERSION' ]
24
+ config . x . release_meta . chat_cache_key = ENV [ 'TAKEOUT_CHAT_CACHE_KEY' ]
24
25
end
25
26
26
27
config . active_job . queue_adapter = ENV . fetch ( 'ENABLE_SHORYUKEN' , '1' ) == '1' ? :shoryuken : :inline
Original file line number Diff line number Diff line change 31
31
# Workers do not work on JRuby or Windows (both of which do not support
32
32
# processes).
33
33
#
34
- workers ENV . fetch ( "WEB_CONCURRENCY" ) { 2 }
34
+ workers ENV . fetch ( "WEB_CONCURRENCY" ) { 0 }
35
35
36
36
# Use the `preload_app!` method when specifying a `workers` number.
37
37
# This directive tells Puma to first boot the application and load code
You can’t perform that action at this time.
0 commit comments