Skip to content

Commit

Permalink
Merge pull request #19 from FranciZhong/db-indexing
Browse files Browse the repository at this point in the history
fix: socket polling
  • Loading branch information
FranciZhong authored Oct 13, 2024
2 parents aa24113 + 5cbd45e commit 4d87d03
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions k8s/chatemo-backend-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: cloud.google.com/v1
kind: BackendConfig
metadata:
name: chatemo-backend-config
spec:
timeoutSec: 3600
connectionDraining:
drainingTimeoutSec: 3600
2 changes: 2 additions & 0 deletions k8s/chatemo-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ apiVersion: v1
kind: Service
metadata:
name: chatemo
annotations:
cloud.google.com/backend-config: '{"default": "chatemo-backend-config"}'
spec:
type: NodePort
selector:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion src/components/HoverTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Props {

const HoverTooltip: React.FC<Props> = ({ content, children }) => {
const [isHover, setIsHover] = useState(false);
const [debouncedIsHover] = useDebounce(isHover, 500);
const [debouncedIsHover] = useDebounce(isHover, 300);

return (
<TooltipProvider>
Expand All @@ -23,6 +23,7 @@ const HoverTooltip: React.FC<Props> = ({ content, children }) => {
<div
onMouseEnter={() => setIsHover(true)}
onMouseLeave={() => setIsHover(false)}
onClick={() => setIsHover(false)}
>
{children}
</div>
Expand Down
2 changes: 2 additions & 0 deletions src/store/socketStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const useSocketStore = create<SocketStore>((set) => ({
connect: (url: string) => {
const socket = io(url, {
path: ApiUrl.SOCKET,
transports: ['polling'],
timeout: 3600,
});

socket.on('connect', () => {
Expand Down

0 comments on commit 4d87d03

Please sign in to comment.