我有一个 React 组件,它从 Flask 后端提供的 url 获取数据,并使用该数据显示折线图。我想刷新前端的图表,而无需用户手动刷新页面。
代码是:
function Graph() {
const [graphData, setGraphData] = useState([]);
useEffect(() => {
fetchGraphData();
}, []);
const fetchGraphData = async () => {
const result = await fetch("url")
const fetchedGraphData = await result.json();
if(res.ok) {
setGraphData(fetchedGraphData);
}
};
return (
<div>
<Container>
<LineChart>
....
</LineChart>
</Container>
</div>
);
}
Run Code Online (Sandbox Code Playgroud)
我尝试在任何地方以及我能想到的任何方式使用setIntervaland setTimeout,但我根本无法让它工作。
我认为这setTimeout应该更好,因为它可以保证在再次执行之前等待服务器响应,而不是setInterval在出现延迟时对查询进行排队。
我们的要求是安排内容页面的内容发布在Tridion CMS应用程序中以重复的间隔运行.我们目前正在使用Tridion 2009 SP1版本.
根据专家的建议如下:Tridion 2009 SP1:如何为重复发布安排内容页面? 我们创建了一个简单的C#控制台应用程序,它引用了Triond Interop .dll,如下所示:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Tridion.ContentManager.Interop.TDS;
using Tridion.ContentManager.Interop.TDSDefines;
using Tridion.ContentManager.Interop.msxml4;
using System.Configuration;
namespace SchedulePublish
{
class Program
{
static void Main(string[] args)
{
//Please use your system related corresponding webdav url's and tcm id's where ever required. Below are just sample :)
TDSE tdse = new TDSE();
//Give some identity that has access rights on tridion UI
string Identity = @"Domain Name\Username";
tdse.Impersonate(Identity);
tdse.Initialize();
string …Run Code Online (Sandbox Code Playgroud) development-environment windows-services scheduled-tasks tridion
请在Quartz Scheduler和线程池上提供一些示例
我想安排从php脚本发送电子邮件.我希望用户指定日期和时间,然后在指定的日期和时间,我希望这些电子邮件自动发送.我该如何实现它?我正在研究codeigniter.
我如何配置一个cron作业每天早上11点运行?我知道如何让它在11点运行,但不是11点运行.
谢谢!